First, you need to disconnect from your VPN.Other users were able to fix their Teams login errors after disabling their VPN.
So, install an older Teams release for macOS and check the results. It seems that Teams login errors occur when your change the password in your MS365 account and the validating server is actually an ADFS server, not Azure.
Don’t worry about it, you can then upgrade to a newer version without logging out. Other users solved the problem by installing an old Teams version. Logging out of your Office apps and signing back in with the new credentials should fix your Teams login issues.
The problem is that your Office apps may still be referencing the old login instead of your new email address. For example, if you replace your old Gmail login with a new Outlook email address, sign out of all your Office apps and sign back in with your new credentials. Many users experienced various login problems after changing their primary login for their Microsoft accounts. If You Recently Changed Your Primary Login in Office Sign Out of Office If the issue persists, navigate to ~/Library/Application Support/Microsoft/Teams, remove the Teams folder, restart your Mac and reinstall Teams.