Technically they make all/most of their money on the games people buy - the PS5 is just barely profitable[0] (but only at its massive scale of >20M units), and the xbox series X supposedly still sells at a $100-200 loss[1].
Why are you making that comparison? Nintendo is known for their strategy of using cheap/old parts in innovative ways to both increase hardware profit margins, and create lock-in (see: https://en.wikipedia.org/wiki/Gunpei_Yokoi#Lateral_Thinking_...). They make quite a bit of money on each Switch sold, as they have on every console previous.
Nintendo lives soley of their games and consoles (unlike Sony and Microsoft), and they do need profit to survive. but they always pushed boundaries and try to deliver the best gameplay.
There are a lot of ways to increase profit, using outdated hardware doesn’t seem the safest way. I prefer to focus on the innovation Nintendo keeps delivering, regardless.
0: https://www.theverge.com/2021/8/4/22609150/sony-playstation-...
1: https://www.thegamer.com/xbox-series-x-s-sole-at-loss-200-do...