I recommend using retry with exponential back off for both http status codes, 429 and 500. That doesn’t stop the internal error from happening, but it does effectively stop the 500’s from interfering with your development and/or application.
Hope that helps.