Clones MCL-16349.
The bug
Upon logging out and then logging back in of a Mojang account while a Microsoft account is logged in at the same time, the Minecraft Launcher enters offline mode for an instant after signing in (around 1 second during my tests), until reverting back to online mode.
How to reproduce
Open the Minecraft Launcher (connected to the Internet)
Make sure you are signed into a Mojang account and a Microsoft account
Log out of your Mojang account from the dropdown menu in the top left corner of the screen
Click Add account -> Mojang Login -> sign into your Mojang account
❌ Notice how the Minecraft Launcher appears in offline mode for an instant before switching back to online mode
Additional information
This issue was more noticeable in 2.2.1166. In 2.2.1260, a fix has been implemented. However, as said in @unknown's comment on MCL-16349, this fix is not perfect. Previously, the launcher would be offline for about thirty seconds, while now, it's typically only one second (in my tests, at least).
I can't reproduce this in the latest version (probably due to the new loading screen).