It is always best to show errors at the original URL rather than redirecting.
For SEO, Google knows how to deal with 500 errors. It will give the page some grace time (probably 24 hours) and if the error doesn't go away it will stop indexing it.
Google will probably treat a redirect to a 500 error the same way, but there is no guarantee. In general, Google does not index redirecting URLs. The danger would be that Google would immediately stop indexing the original URL because it sees a redirect, rather than giving it the customary grace period for a 500 error.
For users, it is also better to show the error at the original URL. Changing the URL is not user friendly. It makes it harder for users to see what happened. They won't be able to note the original URL when they email you or talk to your support. They won't be able to refresh the page to see if the error has gone away.
Most web servers come configured by default to show the error at the original URL rather than redirecting. Unfortunately, it is easy to mis-configure Apache to redirect when specifying a custom error page. Consider this directive:
ErrorDocument 500 https://example.com/errors/500.html
That will cause Apache to redirect to the error page rather than serve up the error directly at the original URL. To fix it, simply make the URL relative so that Apache can show that error page with the error status at the original URL:
ErrorDocument 500 /errors/500.html