Not so much a solution but I can't comment yet. I tried doing exactly the same as you after one of my scripts stopped working and went through the process of Azure and registering the app. The documentation to do all this is massive and I couldn't get my script to work. I could get an oAuth token, set up the correct access policies and all was fine but couldn't get into the mailbox. There are different subscriptions and nothing is clearly defined what is covered in each.
It appears that Microsoft are changing to a new method of accessing emails through their own API and imapclient isn't set up to handle that yet. Their own python libraries I couldn't get to work either.
In all it took me hours and hours of frustration that I gave up and switched to gmail. Everything works... It took a couple of hours, was a similar process: get an oAuth token, set up access policies. Done.
I know this may not be a suitable course of action for you but switching to gmail was by far the easiest solution for me.