This is not true. A walled garden only works well when it applies universally.
When app developers have the ability to bypass the walled garden, they have many incentives to do so ranging from financial to wishing to circumvent scrutiny. This will include an increasing amount of popular and useful apps, decreasing the options available to those who want to stay in the walled garden. For less technical users they will blindly follow instructions to leave the walled garden.
You are removing the choice of users who want a walled garden by supporting legislation forcing these ecosystems open.
Alternatively it just puts pressure on the walled garden to let people do what that want to do safely within the walls so they don’t have to go through the escape hatch.