Browsers intermittantly and unpredictably time out

We have a domain with four IP addresses. The addresses are proxied behind Cloudflare. Load Balancing is enabled. This is an IIS site on the origin server.
Intermittantly, but quite frequently, Cloudflare times out with error 520 or 524 when trying to load pages.
There doesn’t seem to be a pattern as to which page fails. It does seem to fail much more often with POSTs than with GETs, but not 100%. We get the same error with proxy enabled going straight to a single IP as we do with the load balancer.
The site performs correctly when the IPs are unproxied, but we need the proxy. The DNS-only version of the website is The single IP proxied version is The load-balanced version is