Chosen Solution

I have restored it many times and it has the same error. My mac detects it, but only when the screen is on. It only stays on for 8 seconds no matter what. (Even if I’m touching the screen or pressing home button.)

It could be a broken Teperaturesensor. If you are lucky it is the one in the Battery, so if it is possible, try another battery.