I had the same problem with SM 16, trying to import mailboxes from external mail servers. I first tried to use IMAP on port 143 but SM ignores STARTTLS command on port 143 (we opened a ticket about it).
So we tried with port 993 and IMAP + SSL and it worked.
The remote IMAP server was a dovecot. But I don't know about office 365 IMAP server. I think you should look at the Mailbox migration log file, maybe there is something there. On our side we check it and it was empty even we enabled Detailed logging for it...
Sébastien Riccio
System & Network Admin
https://swisscenter.com