Not really my point. My point is more that you suggested no one has thought about this, but yes, they have.
To answer your question, there have been plenty of business who have created and published free software (albeit plenty have later closed them). Notable examples are Databricks, Hashicorp, Mongodb, RedHat.
Sure they've built a moat on top of their free software, but they have (or had) free software regardless.