The error occurs because multiple groups have the same name. In such cases, you need to use a unique property, such as the primary SMTP address, to identify the group. You can use the below script:
Connect-ExchangeOnline
$UserEmail = <MemberEmail>
Get-DistributionGroup -ResultSize Unlimited | Where-Object {
(Get-DistributionGroupMember -Identity $_.PrimarySmtpAddress -ResultSize Unlimited).PrimarySmtpAddress -contains $UserEmail
} | Select Name, PrimarySmtpAddress
Replace the <MemberEmail> with a respective user.
The above script will retrieve all DLs a user is memberof. If you want to find for multiple users, you can use the script available here: https://o365reports.com/2022/04/19/list-all-the-distribution-groups-a-user-is-member-of-using-powershell/