The fact that we have to rely on Hammerspoon or defaults write hacks in 2026 is a testament to the "black box" nature of WindowServer. It’s one of the few areas where macOS feels significantly less mature than Linux/X11, where "Focus Stealing Prevention" has been a standard toggle for decades.
I usually just curse at it and call it names.
Most of my focus issues are at work, so I have no idea what is a macOS issue and what is an issue with the stuff the company installed.
On my personal Mac and phone, I submit feedback to Apple all the time when things annoy me, since those issues are more clear cut.
Notifications should be non-blocking. ALWAYS.