Hi Ian,
I ran into a similar issue myself a few weeks ago just in the regular post/block editor. I suspect that 502 was on an admin-ajax.php call/request? If so, it’s likely the same thing I ran into, which is that Query Monitor adds it’s debugging info into the response headers of the request. I can’t say for sure with Apache/Litespeed, but with Nginx, there is a limit to the size of the buffers used for the headers, which will cause a 502 error when one of those response headers exceeds the buffer size. See https://stackoverflow.com/questions/23844761/upstream-sent-too-big-header-while-reading-response-header-from-upstream for more info and a potential workaround.
With my site, it was PHP deprecations that were being thrown by another plugin, and Query Monitor was catching those and sending them in the response headers so they could be displayed in the QM panel. There were just too many, even when I increased the buffer settings, I couldn’t get it to work, so I had to temporarily disable QM. I probably could have gone nuts with the buffer sizes, but the real fix is to see if you can resolve any PHP warnings/notices being thrown by your plugins (or theme).
Hello @nosilver4u – thank you so much for the reply and explanation. I truly appreciate it. My apologies for the length of time it took to thank you and reply back – have been swamped here!
You’re very welcome, I’m glad I stumbled across your post shortly after seeing the same error on my site a few weeks ago!