If you offboard the shared mailbox back to on-prem, then remove the Azure object and resync with AADConnect, that would work and clean that up.
This assumes its not licensed and not using OneDrive etc...
Once the mailbox is moved on-prem, run this using connect-msolservice against the Azure sycned object to remove it
Remove-MsolUser -UserPrincipalName "sharedmailbox@contoso.com"
Followed by:
Remove-MsolUser -UserPrincipalName "sharedmailbox@contoso.com" -RemoveFromRecycleBin
Then Resync the object from on-prem and move the mailbox back to 365.