I have 2 SPO sites, siteA.sharepoint.com and siteB.sharepoint.com. I have different account on each site.
When I login to 1 site (siteA), then open the other site (siteB) on the same browser, the following screen is shown which is expected.
However, clicking on the link "Click here to sign in with a different account to this site." shows an error page and the URL is appended with the following "_layouts/15/accessdenied.aspx?loginasanotheruser=true&Source=%2F"
Clearing the browser's cookies and cache works as expected, but if any of the site is logged in first, I can't sign in as another user.
This impacts my Powershell app which uses Connect-PnPOnline with the parameter -UseWebLogin because clearing cookies and cache on all browsers doesn't log my account out.