I don't really see PS5 costing more than XBSX to build. Both are expensive.
I am sure Sony was hoping MS was going to charge $599 and Sony would match them and eek out a small margin. But MS which has a LOT more money, chose the (near) Zero Margin route and kind of Forces Sony down the same path.
Bloomberg estimated the cost to build the PS5 was over $450, with most of it going to the GDDR6 and flash memory. Both systems share the same amount of GDD6 so costs are the same there, but Sony's SSD set up is significantly faster so that is going to cost more than MS' solution.