Disclaimer: I really like Open source.

I think without open source something similar might have happened to a lot of software, but instead of becoming Open, they'd become gratis (free/zero cost), or almost so. The heart of the matter is that software has near-0 cost of distribution, so making 1 trillion is basically the same cost (to the developer) as making 1 unit. So since developers have free economies of scale, they are highly incentivized to lower the price to capture most of the market, I think. Software also requires relatively little maintenance, it doesn't rot[1] -- good software basically lasts forever with some minor up-keeping. Add in competition, and the tendency is for cost to go to near 0, at least for relatively popular software. But then there are two problems:

(1) If the company goes under, the software is lost, or rather it could be reverse engineered with huge difficulty and some information loss about the actual code.

(2) The incentives are still not well aligned with users. The makers are incentivized to rely on advertisements, get (and sell) user data, make their software addictive, and more.

On (1), FOSS software guarantees the source will be available and can be ported to new systems, basically becoming a common good. On (2), the incentives are very well aligned for FOSS, development can become a community effort, and in the rare case a developer would turn to collecting and selling user data or dark patterns, the software can be forked for example. In particular Open source funded by grants, donations and community/voluntary work is very aligned with public interest.

I get the downside that it could be unfair that developers aren't being paid as much, but I believe it wouldn't be much of a difference in income (for those kinds of software), and we can and should as a community donate to open source efforts (and since it's clearly in the public benefit I think governments, companies and all sorts of organizations would be wise to do so).

Finally, you're basically still free to create and sell closed source software, you just have to compete with community and volunteer efforts. I think it's well within your right (and it might make sense in some cases, say niche software). But I think it's worth considering carefully wether it's best for the product, for you and for the community to have it closed or open.

(also, indeed you can sell FOSS, but to be honest I don't know of many success stories in this regard (anyone share some examples?); I know arduino which is open software/hardware was very successful selling their genuine boards/having a pay request on download that you can dismiss. On Linux package managers make this difficult, although Flathub recently added donation buttons!).

[1] There are some issues popularly called "software rot", but it's basically some relatively minor (compared to the rot of many physical goods) compatibility issues when interacting systems change.