There is a known issue in Teams SSO login when using Microsoft identify platform (v2) as connection method, and this issue affects users who don't have tokens stored in auth_oidc_tokens table (.i.e never logged in before), or having an expired token store in that table.
We are looking for a solution to this issue and we hope to have a fix ready for the September 2023 release.