If you are operating the phone under “unacceptable” temperatures (https://support.apple.com/en-us/HT201678). According to the link it is also possible that this is because the phone has been charged, and that this has caused the temperature to rise a lot. Try letting the phone cool down if this is the case.
If this didn’t work or if the phone was cold already, it might be a sensor issue, which I don’t think is possible to easily fix.
Did Apple tell you what was wrong exactly or did they just give you the quote?