Outlook Oauth2 - Cannot connect to server. (Command: NAMESPACE; response: #4# [BAD, User is authenticated but not connected.])

According to a quick Google search (result on Stack overflow), this means that you used the correct username/password, but you have not enabled IMAP permissions in your account settings.