If your Microsoft Teams account is locked, it may be due to your account being disabled for signing in. When this happens, your account is automatically removed from all teams. After your account is re-enabled, it may take 24 to 48 hours for your team memberships to be automatically restored, but note that memberships for private channels will not be restored automatically. You will need to request membership again for those private channels.
To recover your account, you can follow the account recovery process through Microsoft Entra ID. This typically involves signing in, selecting "Other ways to sign in," and then choosing "Recover your account" to start the identity verification process.
If you need further assistance, consider reaching out to your organization's global admin or the Microsoft support team for help with account recovery and access issues.
References: