Can you save the contents of the page as a file on your server when it receives the 500 error? It's sounding like you're hitting some type of rate (or resource) limit on the external site and the 5xx error is simply to throttle your queries (either due to policy or by necessity).
In that case, there's no real solution other than to slow down your query rate.
EDIT: Just to clearly explain my thought process... the point of saving the response to disk when you get the 5xx error is so that you can examine the data returned by the remote webserver - perhaps its telling you exactly what the problem is.