While the Wii sold very well for a few years to a large group of casuals, it died very abruptly when the novelty of the waggle fad fizzled out. Wii hardware and software sales literally fell off a cliff years before the competition, which is why Nintendo had to rush out the Wii U. In the end, the Wii did a lot of damage to Nintendo's brand and image in the gaming community and industry. Now it languishes in thrift shops and the games sit in huge piles of forgotten shovelware.
The Wii U was a poorly designed, underpowered, feature-lacking followup to the Wii, again built entirely around an unappealing gimmick, the expensive and spec-sapping gamepad. People don't want to try to shift attention between two screens or use gimmicky motion controls just to play games, as evidenced by the abysmal reception of Star Fox Zero. The Wii U was indeed a failure, not for me personally (why would I buy one?), but for the gaming community as a whole.
The jury is out on the Switch, as of now Nintendo is doing their classic supply-throttling to stoke demand. Besides a few indies and a handful of first party titles, there aren't many games coming. The Switch is unable to compete with the current generation consoles in terms of technology, so it would get watered down ports of 3rd party games (except the indie games) at best. It certainly will be interesting how sales of the handheld go throughout this year and into next year, after the initial frenzy dies down and the game library stays fairly small. A few big Nintendo games weren't enough to save the Wii U, and they won't be enough for the Switch either, assuming 3rd party developers stay away.