They decided to fight Nvidia on the gaming segment and let them win productivity. It seemed like a good strategy a few years ago when GPU were unobtainium, not so much today.
It is only one of the biggest selling consoles in the history of game consoles, breaking the record of GameBoy and PS 4, not a big deal.
Sony/Microsoft literally lose money on each console sold hoping to recoup in subscription and store costs.
The margins in question here are the margins for Nvidia/AMD, not Sony/Microsoft/Nintendo. It would not surprise me at all if AMD makes better margins on the Playstation than Nvidia does on the Switch.
You're asking why a smaller, less funded team, doesn't throw massive resources into following an encumbent with multi-year head start and questionable ability to extract a big profit... vs. spending resources into entering disjoint markets where they can win (e.g. being the vendor of choice of almost every single console on the market - PS5, Xbox, Deck, etc.).
[0] https://github.com/RadeonOpenCompute/ROCm/issues/666#issueco...
[1] https://github.com/ggerganov/llama.cpp/discussions/915#discu...