How do I install macOS Sierra now after all these issues? I upgraded my iMac from El Capitan to Sierra about 6 weeks ago and all was working well. A few days back I decided I wanted to reinstall macOS Sierra so that I had a clean installation that wasn't upgraded from El Capitan, but was 'fresh' with no old files etc.

The first problem I ran into was an endless loop during installation so I posted this question: Stuck in endless macOS Sierra installation loop . Monomeeth got me past this problem by creating a USB installer.

Then I had an issue with kernel panics upon startup after reinstalling Sierra, so I posted this question: Finally reinstalled macOS Sierra, but now I get a kernel panic and William T Froggard and Monomeeth helped me get past that.

Then I got this error message:



Note that is a reflection in the photo, not a GPU problem.

So I followed the advice and tested my hardware. I selected the extended test and over an hour later the test found no issues. But when I restart and try again, it keeps bring me back to the above error.

I do not believe I have a hardware issue as there were no signs of problems before I decided to reinstall macOS Sierra. As I mention in my first question, I decided to reformat the HD by doing a 2 pass secure erase and this was successful. So I think that means I have no problems with my HD right? Plus the 1hr hardware test passed also.

Note that I have already tried booting into the recovery from the recovery partition, and from the internet. I have tried both these options many times. None seem to work. If I hold down alt/option during startup I see a macOS Installer option and a Recovery option:



I have tried both more than once and always get stuck in some sort of loop. 


Either I boot from the macOS Installer option and get the error in
the first image above which goes round in circles because AHT finds
nothing and we do it all over again.
Or I boot into recovery and get the whole endless loop described in my first question Stuck in endless macOS Sierra installation loop that Monomeeth helped me with.
Or I try and boot again from the USB installer Monomeeth helped me create, but while it worked the first time to reinstall macOS Sierra, now I get a gray screen after selecting English for my main language. I'm not sure how this is even possible! Why did it work the first time but not now?


Obviously I wish I never decided to reinstall macOS Sierra, but now that I have, what do I do from here to get it back on this computer?
I've been looking over your other questions and the whole history of your situation and feel like we're missing something here. Not blaming you, I just think something unbeknown has happened (e.g. a power failure at some point you're not aware of that has caused some corruption).

So, I'm suggesting you do as follows:


Start your iMac in Target Disk Mode
Connect it to your MBP (make sure the MBP is connected to AC power)
Run Disk Utility from the MBP to erase the iMac HD (no need to do another secure erase) and also run First Aid
Assuming you don't encounter any errors, do a fresh download of the install macOS Sierra app from the Mac App Store (i.e. do not run the installer from the USB installer you created, but download a fresh copy from the App Store directly to your MBP)
Now run the installer from the MBP
Follow the steps to install macOS Sierra (ensure you select the iMac's HD to install it on)


Let me know if you run into any problems, but hopefully this will resolve the issue once and for all as it eliminates a number of possible problems.