Menu bar unresponsive with external monitor setup
I'm using an external Dell monitor with MacBook Pro M1 with the latest updated version of MacOS. When I disconnect the monitor and switch user, the menu bar becomes unresponsive, and I have to replug the monitor to restore the functionality of the menu bar.
If I log out and try to log back in, the whole system becomes unresponsive and I need to restart.
The screenshot shows how the menu bar is a bit out of its place. Normally it extends below the notch, but when it's stuck, it's more narrow and the text is not aligned properly. When this happens, the Apple menu and the text menu items are not working. The icon items on the right side of the screen work normally.
I believe it has something to do with the scaling and resolution of the external monitor. It has 4K resolution, and the scaling is set to non-default value to have more screen estate.
killall SystemUIServer does not help here.
Twice I tried talking to Apple Support about this, but they didn't have a clue and wanted to send the computer to Apple service, but to me this doesn't seem a hardware failure but there's something in the software instead.
Any thoughts?
Thanks :)
MacBook Pro 16″