Server error on AJAX call, only some users affected

We had an issue that started occurring sometime this morning. Our site does a fetch of a JSON file from the web server every 10 seconds. The file must not be cached, so the request URL has a querystring parameter that changes each request.

Mostly this works fine. Today though some users were reporting issues and it was traced to an error being returned on this AJAX request. Unfortunately we weren’t able to view the actual error because we could not reproduce it, and out error handling is not reporting anything useful in this scenario. It seemed to be affecting the same users on a range of devices. In the end we have bypassed cloudflare altogether and we are waiting to see if users are still unable to use the site, but so far no more calls on it in the last hour (we were getting flooded earlier today).

I know it’s not much to go on but was hoping someone might be able to suggest where to start looking. Why would only some users be receiving this error? I know Cloudflare has a bunch of edge servers that could be serving these requests, is there any way something could have been out of synch so that people coming in via a particular route were affected when others were not? Something we might have configured incorrectly, or something our site might be doing that Cloudflare doesn’t like?

Any pointers appreciated.