A gateway timeout is sent normally by intermediaries like an HTTP proxy when the "targeted" system is not available. That means, that you are reaching out to your publish instances via configured proxy, and the publish instances are not available.
That's a plausible scenario, although I don't know if it matches your setup.