Nintendo marches to the beat of their own drum, they should release Switch 2 when it makes the most sense with regards to their own product lifecycle and not be dictated to by the lifecycles of Playstation/Xbox.
Presuming PS6/Xbox 5 release in 2027, then yes it makes sense for Switch to last that long before being discontinued, but not without being replaced.