When trying to login any Microsoft 365 service in Windows are even through Settings > Accounts you get presented with this error.
As far as I've been able to tell, it seems to stem from past credentials still stored in on the machine.
Follow these steps to fix it:
- Open Registry Editor
- Navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common
- Delete the entire Identity folder
- Navigate to C:\Users\%username%\AppData\Local\Packages\Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy\AC\TokenBroker\Accounts
- Delete all the files in the folder
- Restart all open Office applications and try to log in again