Well, that sounds like a logic board issue, or a heat sink issue. Inside the heat sink, there's an army of tiny thermal sensors that read the temperature of the CPU and GPU. When these sensors fail, they essentially tell the processor that the Mac is on fire. Therefore, the Mac's fan will spin at high RPMs and the Mac itself will not boot until it can cool down. If the Mac is cool and this is happening, these sensors are probably faulty.
If the sensors are fine, then the logic board is messed up.