Gmail is a highly proprietary, constantly changing, email-like product. It is not standard IMAP email, and it will never work flawlessly in standard IMAP clients. (It never has.) Google has always supported IMAP reluctantly and poorly, and that won’t change — in fact, it wouldn’t surprise me if they removed IMAP support in the next few years.
Gmail’s primary, most important, and best-supported client will always be its web interface, with its own native mobile apps following. Everything else — especially standard IMAP clients — is a less-profitable nuisance to Google, not showing ads and holding back feature development by not being under Google’s complete control.
If you want to use email in a browser and Google’s mobile apps, use Gmail. But if you want to use standard IMAP email apps, use a standard IMAP email host.