From what I can gather heating the phone works some times. This sounds similar to the Error 50, which is a baseband chip error. The reason heating sometimes works is that it causes all the solder points to expand and then that allows the chip connect and to work properly, but this will only be temporary. The way to fix it permanently would be to reball the baseband chip.
This is the explanation for error 50 and it sound to me to be a similar issue…
“The iphone 5s has three chips that have to be matched for activation on the apple server these being. serial number/ region/ colour/ WiFi and Bluetooth addresses are stored on the emmc (nand) this is tied to a serial number on the baseband modem and the eeprom baseband memory. During restore all three need to communicate and match. If a mismatch then activation is not possible.”
I am new, so if this is helpful, please click YES.