To make something that has a consistent quality (or look and feel) you'd need to be in control of both the appliance and the ecosystem, and most companies do not have the money or knowledge to do that. It's also hard to make money that way, which is why only a single-digit amount of brand names actually manage to do it long-term.
The only reason we have two choices at all is because there is Apple and there is everything-that-is-not-Apple. The second one is also using a different model (separate hardware and software vendors, and OS forks in varying degrees), but at least the commercial variant has Google behind it with plenty of in-house specialists and money to throw at it. Without Google, Android (as a technical thing) could have been constructed (since it already has been: Maemo, Moblin, MeeGo, Tizen), but has the same problem that all the other non-duopoly attempts had:
1. The content simply isn't there
2. The network effect doesn't catch it
3. There isn't enough similarity and consistency (too much internal differentiation is bad)
This isn't really much of a technology problem as people might think, and inversely, the technical arguments matter a whole lot less than what people tend to attack or defend positions with. The mass market doesn't care how many floating point operations a phone can do, but an insignificant technical fact like that is what is usually used as measurement of 'quality' or 'value'.Regarding smaller scale ecosystems, those exist, but mainly outside of Western Europe and outside the North America. There are billions of people that live elsewhere in the world that do not use iOS or Android, and instead might simply rely on feature phones or significantly reduced smartphones that run a handful of 'apps' and aren't user-managed. Some of those operating systems never make it out of the local markets, and others (like KaiOS) might be available on a broader scale but not really sold retail anywhere outside of their local markets.