You're right. The Switch 2 can absolutely get hacked. Eventually.
What you're missing is the time-frame:
The xbox One was released way back in 2013. It has taken from then until now to discover a vulnerability to exploit. That is 13 years, over a decade of time, for that console to get hacked...