Cartridge era by a huge margin.
Switch was great but that alone isn't close to enough to beat the cartridge era. Not sure if you're counting handhelds or not, but NES/SNES/N64 combined trounces the Switch and the piddling current S2 library. Get back to this question at the end of Switch 2's lifetime when cards and cartridges will have had about the same length run.
Optical disk is definitely the worst.
GC arguably had some missed quality (at the very least Sunshine is easily the worst 3D Mario game, and Zelda on both GC and Wii didn't live up to the legendary standards before and after those years, tho WW is pretty cool and unique), while third parties were good again that gen but it was mostly just mutliplat stuff available everywhere so those mostly don't stand out as unique compared to say the SNES exclusive third party offerings. GC did have some real treasures though, definitely more than the Wii. Wii was cool with the motion controls but a lot of that ended just being tacked on waggle control rather than really turning out improved games with unique experiences, but it at least made for fun party games. Wii will go down with only a handful of great historically memorable games, mostly limited to Wii Sports and the two Galaxy games. And well, WiiU was the WiiU.