I just had this issue happen a week or so ago in my 2015 Model S. I left the climate control running at 81F on a blacktop parking lot, in the sun, in Phoenix, on a 115F day. When I came back to the car 15 minutes later I had this same warning. Within a couple minutes of driving the A/C was blowing hot - outdoor air or hotter. I was able to drive home (7 miles on 45 mph roads) and got no further warning messages.
When I got home I plugged it in and a fan (I think the battery cooling fan) continued running for over 48 hours continuously. It was quite loud. I turned the cabin overheat off as it was well over 105F inside. MCU and all other functions continued to work fine. I tried two-button reset multiple times but that did not help. A/C blew hot this whole time whenever I tried it. Weirdly I could not hear the A/C compressor running and the louvers remained closed. We got lucky that we had a monsoon storm so I opened the garage and blew fans in to try to get the car to cool down
Anyway after 2.5 days or so, the cooling fan turned off. Presumably this warning cleared when the battery temperature finally reached under some critical threshold. When I then tried again, the compressor turned on immediately and the A/C blew cold, no warning displayed. So far it seems to still be working. So at least in my case perhaps it was a software issue that was initially triggered by putting the battery in bad thermal conditions.
I have a service appointment in 2 weeks anyway and will see if service finds anything or can provide any further insights. But otherwise it appears to have resolved on its own once the battery cooled to a safe temperature.