Hook the fresh installed drive up to a USB enclosure and plug it into the "bad" iMac. Hold the option key at bootup. If you see the external MacOS drive detected, boot to it. If it boots you now know you have a SATA connector issue on the motherboard or a bad motherboard.
Temp sensors have nothing to with preventing the computer from booting. They only have an effect on fan speed.