Aside from everyone pointing out that you can't do that on most phones, there's also the fact that installing your own OS will block you from using many apps that check your secure status.
I've been wanting to get into OS dev for years now, I may make an attempt at it soon. When I was younger I built my own kernels for the early OnePlus phones. Maybe I can build an alternative to Android, doubtful but I like a challenge.
The hardest part to making an alternative is the app ecosystem, you almost need a complete suite of 3rd party apps built before you can get any initial adoption.