Hello M Hamza Mughal,
Based on the screenshot you provided, my understanding is you are using the Teams free version, please clarify if I misunderstand your scenario, thanks.
If so, based on my tests and research, as far as I know the Teams for free version doesn't include a feature that "join a team with a code", so it is not feasible to join a team via code in the Teams free, this feature requires in Teams with Office 365 Business subscription, thanks. Moreover, if you joined another teams organization as a guest, you would not be able to join a team via code either, thanks. For your reference https://support.microsoft.com/en-us/office/use-a-link-or-code-to-join-a-team-c957af50-df15-46e3-b5c4-067547b64548?ui=en-us&rs=en-us&ad=us.
On another hand, if I am talking something different from your scenario, please add more clarifications about your teams, and I'd like to help you do more research, thanks.
Best Regards,
Oliver