Grey screen on system wake up
My iMac is set by schedule to sleep overnight, 10pm-8am. The last few mornings when I try to unlock the system (typically around 9:30am), the screen background is entirely gray. On one occasion, the bluetooth mouse was frozen. On the other occasions, when I was able to unlock the system using my password, there are error alerts saying "Unapproved caller. Security agent may only be invoked by Apple software". Also "iCloud Drive may not work properly. Please check the iCloud Preference Pane. Couldn't communicate with a helper application".
Also Finder appears to have crashed and not restarted properly – there is no menu bar and apps (e.g. System Preferences) will not start. The Dock crashes and restarts as I try different ways to get the system working.
Using the power switch, I force the system to shut down and on restart all comes up apparently OK, except that Time Machine does not run on its normal period basis (I have two TM drives) until I manually start a backup, which appears to clear the "blockage".
I have started the system in recovery mode and run Disk Utility on Macintosh HD. It said all was fine. The next morning the problem recurred, so I went into recovery mode again and reinstalled the system software (Catalina, 10.15.6). The problem happened again the next morning.
I'm at a loss! Can anyone suggest another route for diagnostics or even repair?
Many thanks.
iMac Line (2012 and Later)