Additional features, settings, or issues not covered by specific Microsoft Teams categories
I found this thread because I was similarly stuck, and I wasn't able to remove the locked account from the Settings > Accounts and orgs screen. (You know, the logical place to manage these things.)
...However I was able to click "Sign out" from the organisation-selector dropdown in the main window:
https://i.imgur.com/927fCwX.jpeg
This seems to have now removed all traces of the obsolete locked account.
Hope this helps someone.