Screen flashing after wake from sleep
Suddenly, after waking from sleep, the iMac retina display keeps flashing to black and back to the normal desktop screen repeatedly.
I've tried to fix it:
• Safe-boot. But that wouldn't complete the startup. Just hangs after the progress bar completes.
• Shut down from the power button and then startup. Still flashing.
• Clean My Mac and restart. Says Mac is in good shape now. Still flashing though.
• Upgrade from Catalina. (Tried it while the screen flashed continuously.) Hours waiting for MontereyOS to finish installing, but hangs every time at 12 minutes. Tried twice. Would never finish. Shut down from power button. Startup, still flashing.
The only thing that seems to work the past few days is to shutdown then startup holding down command-option-P-R. But couple times using this technique the first attempt didn't work and the screen flashed and the beachball spun erratically and displayed psychedelic colors.
Please help.
iMac 27″, macOS 10.15