Grafana panel intermittently fails to fetch data even though data is present (gives 502 bad gateway error)

Issue:
We have a grafana dashboard with multiple panels. When we try to load the dashboard, some of the panels get updated with data but some other panels show as 502 bad gateway. But upon refreshing sometimes it works. We have tried increasing timeout but still seeing similar results. Is this a known issue or bug?

Concerns:
Is there a recommended best practice for handling long-running Graphite queries through Grafana’s proxy layer?
Should we rely only on [dataproxy].timeout?
Any known compatibility concerns when using Graphite behind NGINX reverse proxy with /render API and wildcard-heavy queries?

Nginx configuration:
keepalive_timeout 65;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;

Grafana.ini
[dataproxy]

This enables data proxy logging, default is false

logging = false

How long the data proxy should wait before timing out default is 30 (seconds)

;timeout = 30

If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false.

;send_user_header = false

Data source connector: graphite

Platform:
Red Hat Enterprise Linux 8.10 (Ootpa)
Grafana version 11.1.0