I glance at the alpine users mailing list. A fair bit of the trafic is about IMAP authentication: GMAIL seems to have changed how that works (OMAP2, I think). People do struggle but have solutions.
Can confirm, Alpine does IMAP with Gmail.
I recall having to set up an application password via Google's web site and use that for ¿OAuth2? authentication, I think.