In the first scenario the error "Something went wrong [1001]" is caused by security software impacting the WAM plug-in (AAD.BrokerPlugin). Please see this article for more details about how to mitigate: Can't sign in to Microsoft 365 desktop applications. To provide temporary relief, these steps may help: More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.