Here’s a useful video from Microsoft on how to fully setup guest access in teams. It involves changing settings in Azure Active Directory, Teams Admin, Microsoft 365 Groups, SharePoint Admin and individual SharePoint sites.
https://docs.microsoft.com/en-us/microsoft-365/solutions/collaborate-as-team?view=o365-worldwide