I don’t have a deployment at the moment, this issue is happening in local development.
We have found the cause of the issue and were thankfully able to solve it.
The issue was a library named pdf-parse that uses nodejs specific features, I had to add it to the serverExternalPackages next.config.mjs file, which I did not.
After adding it to the serverExternalPackages configuration, the endpoint runs smoothly.