Firefox Intermittent 502 Errors

May I suggest looking at the below articles:

Have you checked if you block any Cloudflare connections to your origin host / server?
Like if you have some Firewall or?
In this case, kindly follow the instructions from the below article to allowlist and allow Cloudflare to connect to your origin host / server if so:

Cloudflare IP addresses list can be found here: