Hello I had this same problem. I the moment i plugged in the charger it says battery temp too high shutting down to cool; i was unable to charge the battery. I tried without charging cable and i used a battery temperature app and i was getting erratic readings like -2 F to 0 F and then when i would put in my sim card or try to use any apps it would shoot up to 180 F and shut off my phone. Eventually there was no more power and i was unable to charge my phone. I figured it was the temperature sensor getting loose from dropping the phone.
I thought the sensor was on the battery itself so i bought a new battery but still the same problem; i tried disconnecting various components liek camera, lcd screen, charging port, camera, to no avail.
How i fixed: I removed the motherboard itself and got a heatgun and heated up the motherboard to try and “reflow” the solder,
I laid it on the concrete with the motherboard upside down and heated it by pointing at the square heatsinks on the rear of the motherboard, i did this for less than 2 minutes, assembled everything and now my temperature is reading correctly at 86 F and i’m now currently charging my new battery.
Good luck!
TLDR; a solder or electrical connection got cracked or loose on the motherboard and it needs to be “reglued” back on by using heat