Looks like I broke focus again with this in some cases, some WMs use _NET_ACTIVE_WINDOW = None more often than others (and FVWM would fall in that category as spurious test failures seem to suggest) and it causes spurious focus loss.
I don't have a good solution here, either revert this entirely and consider this as an XWayland problem, and that it should probably focus the root window instead when losing foreground to a Wayland window, or check ourselves for XWayland presence and enable this conditionally.