You call it lock-in but I would call it vertical integration. It is what built Apple’s success. People have told Apple to be more like Microsoft, Dell or HP but people have been proven wrong. The Apple strategy has proved superior. Lots about that strategy annoys me but I still believe in vertical integration as a smart strategy.
The M1 could never have happened if not for the vertical integration strategy.
Not sure why you dislike macOS so much. I have many complains myself but find every other alternative much worse. Windows is a mess drowning in adware and crapeware made by a company which has no idea where they are going. Their UI design skills are atrocious.
Linux had potential but there is just too much software lacking. And what exists with good functionality often had that functionality hidden beholden poorly designed UIs.