Gotta second this on a basic level, the software on the Switch sells simply because it's good software, sadly there was a lot of it on the WiiU but that hardware was a massive barrier which people weren't willing to jump over to get at the software.
The Wii U had a terrible name, and honestly I think the price point killed it. The console was $300, but half (roughly) was due to the controller.... and the Gamepad was terrible. Nintendo could (and should have) gone at $200 with a standard controller and called it Wii HD.
Brand confusion really hurt it as well, 2-3 years after it came out I had people asking me about getting the gamepad for their Wii and just plain not understanding that it was a new system with its own library of games.
Realistically the WiiU was what they wanted the Switch to be, but the hardware wasn't really there in 2012 or well around 2010 when they would have started working on it, from a functionality point of view the system offers the same type of play experience as the Switch but just horrifically hampered by the hardware available at the time, the 640p screen on the gamepad looks very unclear as well after you've played some Switch games.
I guess one great thing came from it if you look at it like that though... it was a prototype for the Switch and it showed Nintendo exactly what fans didn't want.