This can be a once off warning or a sign of a major issue with your device. It also may just be a software glitch.
Being in Australia with temperatures that exceed 35deg in most cities in the whole country during summer, there is a good chance this warning message will appear.
Apple states as follows…
Operate iOS devices where the temperature is between 0º and 35º C (32º to 95º F). Low- or high-temperature conditions might temporarily shorten battery life or cause the device to alter its behavior to regulate its temperature.
Store the device where the temperature is between -20º and 45º C (-4º to 113º F). Don’t leave the device in your car, because temperatures in parked cars can exceed this range.
Once the device shows this temperature warning you should let the device cool down as quickly as possible. Move it into a cooler area and switch it off for awhile.
If after 30 minutes or so (giving it time to cool down), when you turn it back on you still have the temperature warning, you may have to get the device looked at by a repairer.
If the temperature warning is gone then use as per normal.
If you get repeated temperature warnings and you are not in hot environment, then you should get the device looked at by a repairer.
You can guess of course the repairer that we recommend you contact….. that’s right. Us. Phone Repair Doctor