A 500 internal server error is not typically something that would be returned by Cloudflare, looks like you have a way of easily reproducing this which is great.
On your curl command if you add –connect-to ::IP_addr
Replacing the IP_addr with your origin IP of your server. This way you will see the HTTP Response to this request, but taking Cloudflare out of the equation and see how your server is responding. This will narrow to scope of where the problem could be to your origin, or if it is successful then look at other things on Cloudflare that could be causing this.