Why have I been intermittently getting 504 gateway timeout errors?

Same issue here, though I can consistently trigger the error 504 with a specific data replace query.

M0 cluster
Google Cloud / Iowa (us-central1)