AC is cold when engine bay is cold but not really cold when engine bay is hot

So my AC is super cold when my engine bay is also cold. However, when my engine bay is hot, the blowing air isn’t so cold anymore.

In other words, if the car has been off for 6+ hours and hasn’t been in the sun, meaning the engine bay is at normal temps, all good.
If the car has been running for a while or if it’s been off but sitting in the blaring sun, the air isn’t so cool.

Any thoughts?