Demand for 512+gb hasn't gone away though. I suspect we'll see M5/M6 Ultra later this year with 512gb-1tb of ram going for the biggest premium we've ever seen from the company.
It's also a financial optimization: Even with the very expensive RAM upgrade prices, it's way better to use the same memory chips to manufacture and sell four Mac Minis or two Mac Studios, rather than a single high-RAM unit.
It was probably two birds one stone: they could use that RAM for other more likely to be purchased models, and the loss from selling 512GB of "pre-RAM-AI-tax" costs would have been too high. They would have certainly sold those models though.