Hi @eg1995 ，
The official document does not clearly mention that imap migration can be used for personal Gmail account. I tried it here, but there was an error in the sync step and it failed. But according to my understanding, most of the steps should be applicable in theory, as mentioned in the discussions in some posts here, it is possible.
If possible, you can follow the documentation to try it.
(Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.)
Also, you don't need to set endpoints for each mailbox, you only need to set them once.
If the above doesn't work, you could also try to add your Gmail account to Outlook first and export the .pst file, then import the Gmail .pst file to your Microsoft 365 account in Outlook.(I think this way is better, because imap migration can only migrate mailbox data).
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.