Are you considering only in-place holds? You should also check for litigation and retention holds to ensure no mailboxes with other types of holds are missed.
To export mailboxes with in-place hold,
Get-mailbox -IncludeInactiveMailbox -ResultSize Unlimited | Where-Object { $_.InPlaceHolds -ne $Empty } | Select DisplayName, PrimarySmtpAddress, RecipientTypeDetails, InPlaceHolds | export-csv D:/hold.csv -NoTypeInformation
To export mailboxes with litigation hold,
Get-mailbox -IncludeInactiveMailbox -ResultSize Unlimited | Where-Object { $_.LitigationHoldEnabled -eq $True } | select Displayname,LitigationHoldDate,LitigationHoldOwner,LitigationHoldDuration | export-csv D:/hold.csv -NoTypeInformation
If you need to export more details on different types of holds, you can try this PowerShell script: https://o365reports.com/2021/06/29/export-office-365-mailbox-holds-report-using-powershell/
The script provides a summary report of all hold types and generates separate detailed reports for each hold type.