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.
Do you know of a reproducible way to trigger either of your examples on Windows?