Promising users that your platform is "open" when you create it and market it to consumers -- only to break those promises later -- is the reason why Google keeps being found guilty of antitrust violations in jurisdictions around the world.
Meanwhile, walled gardens remain perfectly legal, unless you explicitly change the law.
Look at Microsoft, which created and marketed Xbox as a walled garden with no legal repercussions in the decades since.
However, Microsoft created Windows as an open platform, and then used anticompetitive tactics to retain control (just as Google did) and was found just as guilty as Google in the courts.
When Apple created iOS it was a closed platform. When they added the ability to create third party native apps they were clear that the platform would be a walled garden.