However, they don't need the same heatsinking as linear supplies, so they're less expensive in that regard. If designing an optimal heatsink (which has the second order effect of determining what else around the part will heat up because of the regulator) is a lot of work, then maybe the NRE will be the same. But overall linear regulators are fewer and simpler components so the BoM cost is a lot lower.
Also the waste heat of linears constrains your design in terms of weight, power density, how big you need to make the enclosure, etc.
For reference I looked at what I'd need to buy on AliExpress to power my laptop off the cheapest linear PSU I could find (say 20v 5A), something like: https://www.aliexpress.com/item/1005003397909174.html - it weighs 4kg vs 300g for the charger I have. Apparently there ARE audio people who put their NAS on a linear PSU (I did not realise that was a thing!) but I'm going to try to forget I saw that.
Switching from maybe 70% efficient linear to 80% efficient switcher means only a 30% reduction to copper or transformers.
-------
Today, a switcher is maybe 95% to 99% efficient. So switching from 70% efficient linear to 97% efficient switcher is a 90% reduction in coils/heat sinks.
They were, back in the day.
Around the time the Apple II came out, a (linear) power supply wasn't cheap, but robust. And machines like it were way more expensive than its PS. The complexity of a switcher would affect that cost ratio. So few manufacturers bothered to make the PS as small or efficient as it could be.
But computers became cheaper, some more power-hungry, switching PS designs advanced (and cut down weight, size & the amount of copper needed), and markets grew. And effiency became a thing (see eg. EU regulations). So the economics made switcher designs trickle down to ever smaller & smaller power supplies.
(the latter is still ongoing btw)