A console tends to be at its most profitable during its latter years when it has a large install base. You can look at the chart below and see this with PS4. (Most recent fiscal year is not listed, but it is about the same as 2019.) Switch is younger than PS4 so it still has a couple of years until it reaches it's most profitable time. So even though Nintendo > Sony in profits right now, that gap is going to keep widening. Basically we ain't seen nothing yet when it comes to Nintendo's profit from the Switch.
The latter years are usually not that profitable. For the PS3 , you can see that from 2012 and 2013 the PS3 was hindered by PS4 R&D. Then in 2014 and on the PS3 wasn't all that profitable, to offset the PS4. Meanwhile the PS4 profits in 2019/ 2020 have been hindered by PS5 R&D and the latter years will look even worse.
The Wii U's latter years were straight losses to Nintendo due to them focusing on the Switch.