Hello,
Please see the following guide for adding a guest to a team in Teams:
Also, ensure that Guest access is enabled for your Teams environment:
Guest access in Microsoft Teams
https://learn.microsoft.com/en-us/MicrosoftTeams/guest-access
If this is helpful please accept answer.