I have an M3 Max that does this, but only when I plug in two monitors at once over Thunderbolt. It doesn’t always happen either, haven’t figured out exactly what is causing it. I know my M1 is only capable of a single external monitor, so part of my suspects their multi monitor support is just poorly implemented over the latest TB spec.
Using M1 with a thunderbolt dock doesn’t do it, so I know it’s not the monitor. Plus switching out one monitor for another doesn’t fix it.
In the past to debug this problem I’ve used BetterDisplay