Getting 500 error when creating a project

I am getting 500 errors when making a Invoke-RestMethod call into Jira through PowerShell even though the project creates successfully with the necessary information and can view the created project in the GUI.
I am using the auth with the api token which does successfully allow me to create the project however I return a 500 error from the API request with no other identifying information.

Has anyone else seen this and is there a way to prevent this error from happening?