Hi @Andrii Maslov ,
I have not encountered this issue myself, but have seen some similar cases where this can happen if someone enters a bad password or credentials, or unsuccessful MFA. It will look like there was a successful authentication when there wasn't one.
I found an issue where someone else received this error, and it looks like it can happen due to an incorrect CLI command.
The solution listed in the thread:
proper CLI arguments for imapsync are: --authuser2 "office365_admin@domain.tld" --user2 "user_to_be_migrated@domain.tld" --office2
Before that, the following PowerShell command must be executed: Add-MailboxPermission -identity user_to_be_migrated@domain.tld -user office365_admin@domain.tld -accessrights fullaccess -inheritancetype all