You are using Cloudflare, right? I have a similar issue with CF. Random 522 here and then, and very slow admin access.
So far I didn't find the issue. Something related SSL for sure. Often I get 522 on individual files. Frontend is mostly workable.
522 depend on location too. When I use an IP closer to the server (free windscribe chrome plugin is good for that) I get less errors.
Since one site is a productive site that I really need to work I moved it to BunnyCDN. No issues there whatsoever.
This said, I still like to find out what this issue is. This happens to me only after updating to the latest Wordops.