The Wii U gen was an absolutely necessary failure for Nintendo to learn for Switch.
They had to learn that the Wii days were over, the branding didnt mean anything and those games wont help lighting strike twice.
Nintendo needed HD experience, lots of droughts due to how slow they were to adapt.
I believe their new development structure didnt start until 2013 with the merger of some of their internal teams in one building?
They needed big change to their 3rd party relations.
Lack of middleware and poor documentation hindered those that tried to support and bring their games over.
UE4 (which never came to Wii U) and Unity were up day 1 with an UE4 game shipping within the first month.
The change to NVIDIA seems to have been a great idea. The tech for something like this was finally here and probably cheap for Nintendo.
Its Nintendos best and sleekest hardware to date despite being portable. Allows them to continue using what they learned on Wii U but enhanced.
Theres also Zelda, which had a massive part in helping the Switch be a success.
It took the Wii Us entire lifespan to develop which helped it become a Switch launch title.
Nintendos marketing team went to shit last gen and it was thankfully fixed before Switchs launch. The reveal trailer is probably better than anything they did for Wii U.
All these are things that needed fixing. And they needed a wake up call.