I wouldn't say "GameCube was what everyone asked for".
Who asked for a purple lunchbox console with a kiddified Zelda and losing a lot of the N64's strengths like GoldenEye? Not to mention a Mario game that a lot of people felt wasn't a real successor to Mario 64. The controller while comfortable had all kinds of weird aspects too ... terrible tiny d-pad, one weird Z-button, awkward button shape, secondary analog nub, etc. There's a reason why when you look at Nintendo's pro controller designs since, they've basically ditched all of those elements.
I still maintain the N64 would have outsold the Playstation 1 if Nintendo had just chosen CDs and protected their existing relationship with Squaresoft. N64 destroyed Playstation 1's launch window sales and the PS1 really did not take off that largely in the US until about FF7's release, until then even with a crippled library of games, the N64 was keeping pace.
PS2 is trickier, by that point Sony had entrenched itself into a position where they would have been hard to displace. It was made worse by Microsoft stealing Nintendo's FPS shooter advantage the N64 had (GoldenEye, Turok 1/2/3, DOOM 64, Perfect Dark, etc) with Halo, so they got into a dog fight just for 3rd place.
After that they never really tried to compete directly again. So N64 I think they could have won, GameCube is a lot more difficult. If they accepted a deal from Microsoft to use Windows to basically keep them out of the hardware business and MS agreed to make Halo exclusive for the GameCube ... in that kind of situation, maybe the GameCube sells like 40-50 million units because they'd have gotten the XBox sales mostly and had no competition for the no.2 spot.
Nintendo's marketing wasn't very good in the past either. It's not easy to beat Sony on their turf, and frankly gaming has gotten very violent, lets just say Nintendo had retained their no.1 position. Would they be doing things like Call of Duty bundles today? GTA cross promotion? Alan Wake II where the game starts you off a naked fat man in the woods? Like I dunno ... I kinda feel like the direction the broader development community has gone is too dark/violent that it's kind of awkward with the kinds of games Nintendo makes.
I'm sure Switch 2 will have plenty of theses games of course, but it just feels like maybe Nintendo is not the right company to be leading that part of the industry (the traditional "big box" stationary home console) given the direction of more violence and darker subject matter that the majority of the development industry seems to be interest in today.