Switch is more powerful than Wii U so some games just would not run on Wii U that can run on Switch and some of those running on Switch are at the bare minimum. The other thing is Nintendo used its own API for Wii U. Same with Gamecube and Wii. GX. Not widely supported. Switch uses Nvidia NVN which supports OpenGL and Vulkan. Wii U CPU was a beefed-up Gamecube CPU essentially. Take the bad Wii U marketing aside and Wii U still would not work from its hardware and API alone. Wii U was a half step towards Switch. There is no universe where Wii U is a success story. Nintendo often tries things several times. Motion controls with U force on NES. 3D with Virtual Boy. They tried again with Gamecube with Luigi's Mansion but the glasses were never released. Dual Screens. Game and Watch. Mario Maker was meant for the Famicom. Mario Factory. Mii's were planned back then as well. Nintendo sits on ideas or tries them over and over.
The second screen experience goes back to Neo Geo Pocket Color linked with Dreamcast. Plus VMU. It didn't go well. Gamecube tried it with GBA link. It didn't go well. Sony tried it with PSP and PS3. No one cared. MS almost did VMU with Xbox but dropped it when no one looked at the VMU on DC in focus tests. MS Smartglass was a flop. PS Vita to PS4. No one cared enough. Same with Fallout 4. Second screen gaming is an idea that sounds cool on paper but never worked in execution. DS/3DS only worked because they are right there in your hands. The console side doesn't work.
Oddly Switch is another idea that is old but finally worked. Turboexpress in 1990 was a half step. A portable TurboGraf16 but it could not connect to the TV. SEGA Nomad in 1995 was a portable SEGA Genesis, connected to the TV and had an extra controller port for 2 players. It was an expensive and bad battery life. PSP tried it. PSVita. Some tablets but Switch did it better and had the right timing. Think of it like the Simon smartphone in 1992. A touch screen smartphone in 1992. Many more smartphones were attempted esp in the early 2000s. Didn't take off until everything was in place from tech to form to the world was ready in 2007.