Based on the screenshot, this is an application load balancer (and not a classic or network load balancer).
Here are the docs for ALB metrics: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-cloudwatch-metrics.html
Graph titled HTTP 5XXs is showing the HTTPCode_Target_5XX_Count
metric. Which is the number of HTTP response codes generated by the targets. This does not include any response codes generated by the load balancer.
Graph titled HTTP 502s is showing the HTTPCode_ELB_502_Count
metric. Which is the number of HTTP 502 error codes that originate from the load balancer.
So the issue is with the load balancer itself. See here for possible causes.