Hello @Danyal Ansar :) ,
Thank you for Reaching out Microsoft Q&A.
I understand you want to integrate teams with salesforce but you're getting missing role permissions for 'Team.ReadBasic.All, TeamSettings.Read.All, TeamSettings.ReadWrite.All' but you provided permissions for these API's but still you're encountering the error.
Instead of using Delegated permissions for Team.ReadBasic.All, TeamSettings.Read.All, and TeamSettings.ReadWrite.All, consider using Application permissions and granting Admin Consent.
Could you confirm which OAuth flow you are using—Client Credentials flow or Authorization Code Grant flow?
If you are using the Client Credentials flow, you should use Application permissions. If you are using the Authorization Code Grant flow, you should use Delegated permissions.
Hope this helps. Do let us know if you any further queries.
Regards,
Goutam Pratti.