It doesn't occupy anywhere near the same market niche though. PS5 will occupy the exact same market niche as PS4 did, distinct from Switch, so nothing will change there.
Do you think the N64 and PS1 were competing? How about the Gamecube and PS2? I think these systems were competing. Playstation kept gaining marketshare with each generation while Nintendo was losing it. They were competing. What kind of games did Nintendo make during this era? 3D Mario, 3D Zelda, Mario Kart, Smash Bros, Animal Crossing, etc.... They were making the types of games that are selling the Switch right now.
PS5 and Switch do not occupy a different market niche. They will compete over the same gamers just like the PS1 and N64 did. They make the same type of games and therefore appeal to the same type of gamers. They most definitely will compete.
The main thing that has changed is that Nintendo has a lot more advantages this time around:
1) The franchises I listed above are much more popular on Switch.
2) Switch is a better value than a traditional home console, because it can be used as either a home or handheld system.
3) Switch has a much bigger third party library compared to N64 or Gamecube.
4) Switch will always be significantly cheaper than PS5, which is a huge advantage in a recession (like the one going on now).
Nintendo is making the same types of games that it has always used to compete against Playstation. That is why it will compete against the PS5. The main difference is that Nintendo is much more prepared for this contest, and that is why the Switch will prevail against the PS5. Same competition. Different victor.
Again, you're trying to force Switch into the paradigm of past generations which it just doesn't fit due to its hybrid nature.
PS5 will fill the same market role as the PS4, so if Switch didn't directly compete against 4, there's zero reason for it to suddenly compete against 5.
Let me put it this way; no system with a direct competitor as successful as the Switch has ever sold better than the PSP. (And even then its questionable just how directly PSP and DS competed) How much do you expect PS5 to sell, lifetime?