IMO, nothing should ever steal my keyboard focus. As soon as I've typed a single character, whatever happened before, too late for you.
Is it could be a bug (IMO yes, a credential disposition / security bug), or it could be a "feature tax" to keep the tracking context hot for whatever page you logged out of LinkedIn to avoid being tracked...
Nevertheless, the OS could conceivably track whether there was any focus change since the process was launched or since it received the last key-press or mouse-click event, and only allow the focus change when there wasn’t (and otherwise use a non-focus-stealing notification mechanism).
It’s too bad that the art of building lightweight applications is becoming a lost art.
I can't believe in all these years they haven't implemented a dual setup where they connect the wifi and do some kind of test connection or request to confirm it's a stable signal before entirely switching away from cellular data.
Maybe you’ve turned off WiFi Assist? It’s an option to allow mobile data to supplement WiFi.
If it's enabled, it tries as hard as can be to 'assist', even if the Wifi is bad, and it should have given up a long time ago.