The GameCube was a flop mostly because of image and marketing, not because it wasn’t technically good.
I have one and I love it, but I only got it long, long after release.
What 12-year-old boy asking for a Christmas present is going to choose the cutesy purple brick that “only has kid games” over a sleek black PS2 that is seen as being adult, with action and fighting games? Not many, and so the GameCube flopped.
I think Nintendo were starting to see at that time that consoles weren’t just for boys. They were for girls too, and for the whole family, and the GameCube was a step towards that. But it didn’t go far enough. They ended up stopping short and falling smack in the middle where it didn’t appeal to the established ‘male gamer’ demographic, and still didn’t grab families either.
Then the Wii came along and went HARD on the family-friendly aspect, and just blasted off the shelves. Nintendo learned a lesson, but the GameCube was the price they had to pay for it.