Teams and SharePoint Online share a connection through the Files Channel tab. Unfortunately, if you rename the URL of a SharePoint site, the connection broke. The good news is that Microsoft has now fixed the problem. Some pesky bugs got in the way, one of which stopped the connection being restored. But the developers persisted and the final bug was fixed last week.
The Get-SPOSite PowerShell cmdlet is used to fetch details about SharePoint Online sites. It works well, but some recent functionality upgrades means that script writers need to be more precise about how they use the cmdlet. Most scripts don’t need to process redirect sites or the sites belonging to Teams private channels, so why would you ask Get-SPOSite to fetch these sites?