You can use the command Get-MsolUserGroup to resolve this issue.
Installtion
Install-Module -Name Microsoft365.Toolbox
Usage
Import-Module ActiveDirectory.Toolbox
Commands
Get-MsolUserGroup [-UserPrincipalName]
Link for download
Note:
#Requires -Modules MSOnline