I know people who run their own email. They don’t self-host, but have a domain and setup email through whatever host they are with. Over the years I’ve seen them run into issues with deliverability, host migrations, spam, hackers, and other such things. It all seems very annoying. Self-hosting would add another layer to that. I simply can’t be bothered.
I like the idea of it, but would hate the reality of it.
Mail clients support SASL XOAUTH2 using hard-coded client IDs/secrets only for a handful of service providers; there is typically no user-facing way to add others, even via enterprise policy.
RFC7591 and RFC7628 mostly solve this and have been around for a decade or so, but have been universally ignored by mail client developers because Microsoft and Google haven't implemented it.
Self-hosting (everyone has its own mail server) is not easy. You have to keep at least one server (possibly two or more), backups, buy a domain and an MX record, plus DKIM/SPF/DMARC, get a static IP (is MX compatible with DDNS?), ensure exposing mail servers to the Internet doesn't violate TOS from your own ISP if you do it at home (based on what kind of contract you have, it might be a thing), ensure your emails are actually delivered and your domain is not blacklisted, ensure your mail server is sufficiently secure (firewall, regular patching,...). These are just the basics. Then you might want to enable some kind of logging (and keeping it safe), automatically discard obvious spam, and so on.
Non-technical individuals cannot easily do all this. Remember even using a custom, non ISP-provided router is something that the public usually doesn't do.
Technical individuals could do this, but not everyone wants to do IT stuff in their free time. I'm a sysadmin, I have never set up a mail server but cloning your repo and following instructions I'm fairly confident I could do this (though deliverability is a whole other thing)... but I don't want to be a sysadmin even at home.
Currently, I don't see self-hosting as a convenient enough solution for me, when comparing pros to cons.
Lock-in is another issue that is not necessarily solved by self hosting. Other non-Gmail mail servers exist. The main reason behing Gmail's lock-in is 1) it easily integrates with other Google stuff, and 2) all websites support registering, notifications,... with Gmail accounts.
When it comes to 1), not all people care, and some alternatives provide somewhat similar services (calendar,...), although obviously not integrated with Google.
As for 2), this is not solved by self-hosting, unless self-hosting gets so popular that websites have to support all kinds of domains to not lose market share.
The flip side of that is that spam can eat you alive.