For over 30 years Nintendo hardware and software have been tied directly to each other. If you wanted to play games by Nintendo, you needed hardware by Nintendo. They're only now branching out slightly with Pokemon GO and the upcoming Mario app. Things would have to get REALLY bad for Nintendo to do what Sega did 15 years ago when they abandoned hardware and just went all in with software. And even though Nintendo has had some rough patches lately, fact of the matter is that they have a TON of cash in reserves, like to where they can run in deficit for
30 years without running out.
That's true but many people, including myself would be fine with seeing that come to an end. There is nothing all that impressive about recent Nintendo designed consoles. I don't own a Wii U but my 3DS XL feels like a cheap toy next to my Vita. Their UI and social features are terrible when compared to other modern consoles too. Not only that but there is no reason they couldn't make Zelda, Mario Kart, Smash, and Mario games for PS4, Xbox One, and PC that are every bit as good as what we saw them do on Wii U. Think how many copies they would sell of those games if everyone could buy them for their platform of choice instead of just the 12 million Wii U owners.
Sure, they might have enough cash on hand to lose money every year for a long time before going out of business but their shareholders would never accept that. The stock price would plummet and another company would end up buying them out just to get the IP.
The fact is that every Nintendo console since the Super Nintendo has sold less units than the console before it with the exception of the Wii. They are clearly on a dangerous downward swing. The Wii sold amazingly well but that was an anomaly fueled by a bunch of people who don't normally buy games but had fun with Wii Sports and decided to buy one. The problem is those people didn't continue to buy games during the Wii generation and they certainly didn't support the Wii U. Even the PS Vita, which most people consider a failure, outsold the Wii U.
You say things have to get really bad for Nintendo to follow Sega's lead but I would argue that things are already pretty bad for them.The last time it was reported the Wii U had sold 12 million units. Sega's last console, the Dreamcast sold 9.13 million units. They are in the same ballpark and if it wasn't for the 3DS sales numbers things would be looking pretty bleak for Nintendo right now. Those 3DS numbers and the massive amounts of cash they brought in from selling the Wii are the things that separate Nintendo from where Sega was after the Dreamcast.
They still have some rope because of those things but if the Nintendo Switch does not do significantly better than the Wii U I think it will be their last console. luckily for them the buzz around the Switch seems to be incredibly positive right now. Instead of people mocking them like they did when the Wii U was announced people seem genuinely excited about it. Also it would be really hard for them to not outsell the Wii U. The number to beat is really low and they are going to get sales from people upgrading from both the Wii U and the 3DS.