Nintendo has had a couple of botched consoles, or at least ones that didn't sell (N64, Gamecube, Wii-U), but the original Wii was a huge hit that filled them to the brim with cash.... and the 3DS and Switch both sell pretty strongly - so this has to be a troll thread with the Switch doing well. Even with the Wii-U disaster, they were probably 2 or 3 more failures from being a Sega - and for whatever reason their IP has much more staying power even if their consoles faulter. Mario > Sonic x1000.
That being said, they have sort of abandoned the "home console" space. So I'm not sure where they go next gen to get back into that, or are they just going to keep making portable or "switchable" consoles into the future.