Disable forced OAuth for Gmail on Office 2016, 2019, 365

All MS Office versions >2013 now insist that I use OAuth to login to Gmail IMAP. I prefer to use good old IMAP with simple authentication and I have setup my Google account with an app specific password that does not require OAuth or 2FA. This works well on all mail clients, except Outlook 2016, 2019 (365). I have tried many solutions but I can’t seem to stop this behaviour. Funny thing it I can add the account successfully from the Control Panel Mail settings - it validates credentials and everything. Yet when I open Outlook, the Gmail OAuth login keeps popping up and won’t retrieve emails. I have even added the registry keyword to disable modern authentication but it hasn’t helped. Has anyone figured out a way to use plain old Gmail IMAP with simple authentication on newer Outlook versions?