What you’re saying is: there is a cause for this issue that occurs when a module is loaded that causes the behaviour.
It’s very likely an app that you use frequently that causes the issue. You would need to monitor (as would I), which app that would be. The easiest, but likely not practical in your normal workflow, way to see that is to use one app at a time and then see when the issue starts to occur again.
I’m in the same boat. I couldn’t say which app it is, or whether it’s a class of apps that uses the module, which causes the problem to occur.
I did not say: remove the app. I said: restart in safe mode, which only launches the OS and does not load other modules. When you reboot after that, that module not being loaded at startup, the problem does not occur.
There appears to be an app/procedure that allows the user to see which module steals the focus. I don’t know how to use that procedure. Once identified, killing that process in the Activity Monitor will likely stop the issue from occurring.
I’ll be happy to use my little procedure for those times the problem does occur, which is not all that frequent. That is not enough as a final solution, this is how one module is created and that has to be addressed by whomever created it.
Figure out what that module is, what app it is connected to, share that knowledge with this community and think of Jack Woltz when you write the developer responsible for creating the problem.