If an incorrect password is entered multiple times, after several unsuccessful login attempts, your Office 365 account will be locked.
If you typically use an Outlook.com account for email, this issue can occur if there are multiple aliases on the account and the 3rd party email address is the primary alias.
Windows will completely ignore the password entered and automatically try to use your old password that is still stuck in the cache.