There are 2 possible scenarios for resolving this:
1- Run the below command on on-premise Exchange to check the mailboxes GUIDS
Get-RemoteMailbox UserB | Format-List ExchangeGUID
You should receive an answer similar to this:
Run the below command on Exchange Online:
Get-Mailbox UserB | Format-list ExchangeGuid
You should receive an answer similar to this:
If the GUIDS are not matching, you found your problem.
Resolution is to run the command below and rerun “Complete-Migrationbatch” cmdlet:
Set-RemoteMailbox UserB -ExchangeGUID 4a502e5e-5064-4f60-b691-845bdaf94113 #Online MailboxGUID
2 - If the “Get-RemoteMailbox” does not return a thing for our user it means that it wasn’t migrated successfully.
In that case, you have to remove the online mailbox for UserB:
#In Exchange Online Powershell verify the recipient type. If user mailbox, then you need to remove the mailbox.
Get-recipient [alias]
#Go On premise to see what the recipient type is as well. Run the same cmdlet as above.
#If verified that we have 2 different mailboxes, then we need to purge the cloud mailbox since it is new and has no data. Please be sure that the user is not using OneDrive or Sharepoint.
#If so this data will need to be backed up prior to deleting the msol account. After deleting the MSOL account the OneDrive and Sharepoint data will be gone.
#Next Get the External Directory Object ID from the O365 mailbox.
Get-Mailbox UserB |fl *external*
#Verify the msoluser account.
Get-msoluser -objectid [insert external objectID from above]
#Remove the msol account
Remove-msoluser -ObjectID [insert objectID from above]
#Purge the msol user account
Remove-Msoluser -objectID [insert objectID from above] -removefromrecyclebin #This step is very important to do. If you don't remove it from recycle bin new DirSync will pull the same one.
#Verify the object is gone.
Get-msoluser -objectid [inset external objectID from above]
#Initiate a Dirsync Cycle
#Go back to the O365 portal, verify a new object has been created.
#Or you can run
Get-msoluser -userprincipalname UserB@tech-trainer.info | fl
#You will see a new object ID.
#Next go back in the Exchange Admin Center and migrate the user account.
I hope this will solve your problem.