Off the Shelf?
The off-the-shelf software market is a very small part of the overall software market; the vast majority of software sold is custom software. Even if off-the-shelf software were to disappear completely, the software market would still be huge.
There's no reason why all custom software can't be free software. Custom software is paid for once, and then usually completely owned by the customer. Since all rights are assigned to the customer, it fits the Free Software Foundation's definition.
The availability of a FOSS stack benefits customers and software companies implementing custom software. They can take a FOSS operating system, database, web server, and so on and modify them without having to pay for that privilege. This saves the software company from duplicating effort and saves the customer from paying for duplicated effort. It also drives down the per-seat costs; because the software is free, the customer, not the supplier, decides how many people can use it.
This doesn't mean that the developers aren't paid; they're paid for doing work of value to a customer, not for working to create a product whose value derives solely from an artificial scarcity.