Chosen Solution

iMac 27 mid 2010. Screen randomly turns off/on after OS’s boot. I tried to replace the inverter board and the power supply from fine working iMacs, tried to connect it to working Macbook as external monitor, formated HDD and reinstalled with different versions macOS’s, also tried the lcd display cables they seem to be fine. So the problem remains. Any ideas? Thank you!

When you are swapping parts out are you resetting the PRAM? Often you’ll need to do this or the Mac will not accept new parts.

Shutdown cause should be stated in Protocol system.log https://apple.stackexchange.com/question