Nintendo's games on the N64 were mostly outstanding, as were the games made by their former partner, Rare. Ocarina of Time (highest rated game of all time - missing from your list) and Super Mario 64 were considered to be 2 of the greatest and important games of all time.
The problem they had was that they chose to carry on using cartridges and these cost several £ to produce. Sony meanwhile went with CDs and these cost several pence to produce. This meant that most third parties sided with Sony because the profit margins were so much better - which also led to cheaper games on PlayStation. No only that but the CD format allowed for full motion video, higher quality music, and increased voice acting due to the much larger storage size - 650mb vs 64mb.
By the time Nintendo released the Gamecube, Sony had already established a user base which they successfully moved to the PS2, which was an absolute juggernaut of a console. Combine that with society being in a different place with people not quite as interested in cartoon-y games and it led to Gamecube becoming the worst selling Nintendo console of all time (for the time).
Nintendo's only choice after that was to try something different which led to the Wii being born.