This is a problem that occurs when you remove a Gmail account from Outlook and then re-add it. Normally when you add a Gmail account, you get a window that asks you to sign in to Gmail. But if you removed your account, then that window might never appear. This is because Outlook did not properly delete some entries in the registry.
I would recommend you remove all email accounts in Outlook using the Mail setting in the Control Panel before this fix.
Open the registry editor and go to:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Common\Identity\Identities
(Note: the number may not be 16.0; it might be higher or lower so be sure to check all similar entries).
Delete any entry with your email address in it. If you removed all email address, delete every entry. After that, re-add your Gmail account as normal.
Although I haven’t tested this, I would think this problem would also appear for Hotmail/Outlook and Yahoo email because these also use the OAuth2 standard.