Microsoft is the complication. Windows won't respect your default browser choice and will forcibly open Edge in some situations. It will also take any opportunity to nag you into changing your default browser to Edge.
Does it though? I use Windows and this has not been my experience for many years. There was a time, quite some time ago, when resetting the default browser was pretty common.
Do you know of a reproducible way to trigger either of your examples on Windows?
Click any link on the lock screen or in the system settings menu.
I don't have any links on my lock screen, but some settings links do open in Edge; others open in my chosen default browser. This inconsistency should be fixed, but I'm not sure what a browser choice screen does to fix this issue.
Windows nags you about 4 times with dark patterns to swerve you off that path.