It's hard to say without any more info but maybe it's having issues connecting to the database and its taking a long time to timeout?
What are you timeout settings? You say it fails with ERR_EMPTY_RESPONSE 50% of the time, does it work correctly the other 50%?
If your RO server is offline does it still do the same?