Put simply, don't buy products that lock you in if you don't want products to lock you in. It seems like consumers are capable of making decisions based on price, durability, features, color etc. why is any other variable sacred?
The answer is consumers don't care about these issues enough to pay for them. Would we have this right-to-repair argument if consumers went out of their way to buy repairable devices? Lenovo, Apple, Google, et. al. have been moving to solder more and more components to the board and glue everything together and consumers haven't punished these producers with their wallets yet. If you want a repairable device, buy one -- this isn't a consolidation problem. If you want a phone that you can run a different OS on, buy one. If you want a red toothbrush, don't buy a blue one and complain (or make a law) that it should be red.
Pine64 is a for-profit entity. If you want a repairable phone that you can side-load anything on, maybe give your money to them instead of Google-Apple. Likewise, if you want a repairable laptop maybe buy a Librem 14 instead of an MacBook. Maybe if you want an open hardware ePub reader buy an InkPlate instead of a Kindle. These things exist and more would exist -- with more polish -- if people voted with their wallets. These are real companies trying to make real money with real products for real people.
The smart phone operating systems you listed would have flourished if more people purchased their respective devices. You can't install Sony's OS on an XBOX and while I don't purchase consoles and think buying a single-purpose gimped device is almost always a bad idea, if people want to buy what XBOX is selling, so be it. Apple consumers are not left in the dark about their ability to use an alternative app store and while I think it's a horribly limiting experience, Apple consumers keep throwing money at the company.
I'm not just blaming the consumer. I'm also stating that the consumer is a vital part of the market and their action or inaction results in a market more aligned with those decisions.