The server is responding and not under load, and if I change my DNS to not use the Cloudflare proxy, the problem clears entirely.
The server firewall has all the Cloudflare IPs allowlisted, and I have the Cloudflare SSL cert in place. (I was using Flexible SSL but changed to Full and added the Cloudflare SSL in an attempt to stop the intermittent errors).
I’ve worked through all the options on the Cloudflare 521 help. There are no relevant errors in my site logs.
Not sure where to look next to find out exactly what is stopping Cloudflare from connecting to my server as usual. It will work perfectly for 20 minutes then throw 10 errors for no obvious reason.
I’ve had this same cloudflare setup for years. It’s a Pro account. My site is https://shopontheborderlands.co.uk/