Indeed, I need to remember to unplug the USB-C cable between my macbook pro and my screen, otherwise it flickers on and off every couple of seconds during the night
wired controllers on nintendo switch docks do this, and yes, it is really annoying. It is about every 3 minutes. and it's for the same reason as the macs and windows machines - the switch wakes up and checks for updates then goes back to sleep.
IIRC you can’t run updates while the laptop is asleep though, as that typically requires a user password to initiate. Even with MDM you can’t force updates during sleep
That problem is solved by the Bootstap Token in modern macOS and MDMs which support it. The token gets escrowed with the MDM during enrolment and can be used to unseal the volume for updates without prompting for a password. Good for unattended updates to kiosks or whatever.