Meh, kinda pointless comparing to the Switch when it's a portable and the PS4/PS5 aren't. It's common knowledge that dedicated consoles have been selling less and less in the region for years.
And unfortunately for Japan both the 360 and the PS4 have shown that you can be ridiculously successful even if you don't sell much in Japan.
I'd love for Sony to fund more Japanese projects but it should surprise no one that their focus is outside of Japan.
I think there is still a place for traditional consoles in Japan. The fact that Japanese people prefer the hybrid switch to the cheaper handheld-only lite model tells us that. Obv it's easier to go that way when it has the handheld mode as an option, but that's not the whole story.
The problem for Sony is that although they're not doing much different than those days when the PSX/PS2 were riding high, they didn't
need to do much then after the PSX was up and running. They had the most popular console. Cart licensing compared to CD costs made N64 prohibitive and the Saturn was tough to develop for with less powerful 3D abilities, and then the PS2 got the benefit of succeeding the most popular console, having a DVD player and making no real misteps. They got all the games from small pubs without even having to ask for it. SCE Japan worked with a lot of devs to make cool quirky games too (as I said above, I fondly remember Arc the Lad & Jumping Flash).
But when the PS3 arrived the HD costs hit hard and a lot of these games went handheld, mobile, or just disappeared. Sony still got some with PSP to PS3 ports and PSV to PS4 ports, but they have no handhelds now, and the best they'll get is some switch ports and stuff that will sell well in the west. Anything more they'd have to actively encourage. But they're not doing that and they're not making anything with the JP market in mind.
Nintendo's strength is their backbone as a software developer that makes games that the Japanese public want to play, and in turn it's now seeing support from the smaller Japanese devs that are still around. Being playable in handheld mode is certainly a factor, but it's the games in the end - the Wii was still selling like gangbusters in Japan while the PS3 was struggling due to their games. Sony would have to spend a lot of money in the Japanese market to make a difference (to not much short term gain), and given their western success that's just not something they seem interested in doing.