The entire concept of generations only really made sense for certain major home consoles, and only because going back to the 8-bit days we had mostly clear cohorts of major systems released in close proximity to each other after a gap of a few years and typically (but not always) with comparable capabilities. We had sort of a concept of generations decades ago. We had the 8-bit (NES vs. SMS), 16-bit (Genesis vs. TG-16 vs. SNES), and 32-/64-bit (PS1 vs. Saturn vs. N64) eras and so on. But there's always been issues with the concept of console generations.
Having actual numbered generations as we typically identify them as today is actually a result of a general consensus that emerged on Wikipedia years ago. But that system lumps all cartridge-based pre-Crash of '83 consoles into a single "Second Generation." I've seen one or two other sources split that generation into two, with one source having the the initial 1977-78 wave of the Fairchild Channel F, Atari 2600, and Odyssey² as one generation and the Intellivision, ColecoVision, Atari 5200, and other 1980-82 consoles as another separate generation. Other sources consider them a single generation. After all, the 2600 dominated that entire timespan, the 5200 existed alongside the 2600 and never ended up replacing it, the Intellivision and ColecoVision were developed to compete with the 2600, and the 2600 itself, despite releasing in 1977, didn't really kick into high gear sales-wise
An the troubles just continue. Most professional journals that were trying to delineate console generations prior to the current Wikipedia consensus didn't even consider Pong machines to even be a console generation, while Wikipedia classifies them as Gen 1 consoles. Even with post-crash consoles you had a bunch of failed also-rans that released at odd times, like the 3DO and Jaguar releasing a just past the halfway mark between the SNES and Saturn/PS1... in North America. Which brings me to another complication: highly staggered releases for consoles in the 80s & 90s. Simultaneous or near-simultaneous worldwide releases are the norm today, but at one point it was common for hardware originating in one market to not see the light of day for many months in other markets (and multiple years in the case of the NES & SMS because of the unusual circumstances brought upon by the Crash of '83). That can sometimes make categorizing consoles by release timing difficult, similar to our current conundrum with the Switch.
And then there's handhelds. The Game Boy, Genesis, and TG-16 were all released within a one-month time span, so it's reasonable to consider them part of the same generation on the basis of release timing despite the huge gulf in hardware capability. But the Game Boy also had the most protracted life cycle of any console ever, home or handheld, not being replaced for 12 years after its initial release, basically spanning the entirely of what we now typically call Generations 4 and 5. But is the GB Color its own system separate from the original and therefore part of a different generation, or just a belated spec upgrade to the original? Nintendo seems to think the latter, lumping GBC sales in with the old B&W screen model. Meanwhile, Wikipedia says the former, lumping the GBC in with Gen 5 consoles. I'm going to go with Nintendo on this one since they built the thing.
But now we have another complication. If System A is Gen #, then is its successor automatically Gen # +1? If that's the case, then is the GBA a Gen 5 console despite releasing in the same window as the PS2, GameCube, & Xbox. Nobody ever seriously argues that, though. Most people consider it Gen 6, same as the home consoles released around the same time. Nintendo simply never had a true Gen 5 handheld. From 1989 to 2012, Nintendo released five home consoles but only four handhelds.
That brings me to the Switch. Since it's technically-but-not-officially a handheld, comparing specs to home consoles is pointless, even if the gap is far closer than it used to be. Release timing is of no help, either. It actually launched closer to the PS4 & XBO than to the PS5 & XBS (40 months vs. 44 months in NA, or 36 months & 44 months in Japan). But it also spent more time competing against the PS5 & XBS prior to its own successor being released. Which metric counts more? Who decides? Saying "The Wii U was Gen 8 so by default the Switch is Gen 9 and Switch 2 is Gen 10" isn't necessarily a valid argument for reasons I mentioned in the above paragraph. It's basically a kinda-sorta inverse of the GBA situation. While the GBA was a successor of a system that spanned two whole generations, the Switch was a system that released right smack dab in the middle of an ongoing generation, having being the official successor of Nintendo's final "true" home console.
Classifying the Switch 1 & 2 is messy. Even the NPD Group/Circana couldn't decide. It was considered "current gen" when it was up against the PS4 & XBO (likely why Wikipedians had a general consensus to classify it as Gen 8), but kept the same designation when it was up against the PS5 & XBS. They probably consider it "last generation" now that the Switch 2 is out. At this point, I'd consider it reasonable to simply apply the concept of "generations" strictly to home consoles, and put handhelds & hybrids into their own category. But even that would have difficulties with clearly-defined generations. It seems reasonable to do so at first. You had that 1989-91 wave of the Game Boy, Lynx, TurboExpress, and Game Gear that put handhelds on the map. You had the Game Boy seemingly all by itself. Then you had the DS vs. the PSP, then the 3DS vs. the Vita, and then the Switches by their respective lonesome.
But it actually isn't that simple. There was a whole swath of failed cartridge-based handhelds released from 1979 to 1984, well before the Game Boy was even conceived of. Do we just lump them all into a "Generation One of Handhelds" and have the Game Boy and its contemporaries as Gen 2? Then there's the issue of where the mid to late 90s & early 00s handhelds fit. The Nomad was released in 1995 (and do we even count that as it was just a portable Genesis?), the Neo-Geo Pocket in 1998, the WonderSwan in 1999, the GBA in 2001, and the N-Gage in 2003. Oh, and the WonderSwan and Neo-Geo Pocket also had colorized versions both released the year after their original monochrome models. That's basically a string of systems all clearly released well past that initial 1989-91 wave, but also over a time span of eight years, with the N-Gage releasing only a year before the DS & PSP. Where do all of these fit, exactly, if we were to use a separate system of numbered generations for handhelds? There's really no definitive way to answer that question.
And let's not even get into the issue of dedicated handhelds like the old Tiger Electronics LCD games, Nintendo's Game & Watch series, and those old VFD games made by companies like Tandy. That's a whole can of worms even worse than the Pong machines situation given how long those sorts of games were being made (Tiger's LCD games were still being released well into the 90s).
Generations may be useful shorthand for most notable systems, but it's not a hard-and-fast classification system like some of us might think. There's no real "official" status to any of it and therefore no real rules & definitions to speak of. The boundaries can be fuzzy. It's certainly not something worth arguing over because someone thinks it makes a system "worse" or "better" because it is or isn't classed in some arbitrary cohort conjured by some geeks online 15-20 years ago that needed some way of categorizing things for an online encyclopedia.
Further Reading: https://sites.pitt.edu/~ckemerer/Video%20Game%20Reexamination%2020170216-submitted.pdf (see the graph on Page 9 to see how messy categorizing consoles can be)