For me it’s definitely gen 4 (heartgold and platinum are just. top tier), but gen 5 is really close. Really polished and challenging games all around
I also think gen 7 is pretty underrated, especially USUM which got a bit of hate for being too similar to Sun and Moon. Which is kinda true…but I think the end result was pretty good all things considered.
Other than Gens III and IV for pure nostalgia factors being the first games I played and whatnot (and HGSS being fucking amazing) I’d give a huge shoutout to Gen IX. It’s the first generation where I actually felt that magic that made Pokémon click with me so long ago.
If bugs and performance issues can ruin the experience for you, they’re definitely not recommended, but I don’t mind that much, and in terms of story, music, gameplay and exploration, I think Scarlet and Violet are possibly the best games in the series. They would’ve been perfect if gym leaders and titans scaled with the level of your Pokémon party, though then again, it was also very fun running around wherever and actually losing to them because you went to a town you weren’t supposed to yet. I enjoyed how little hand-holding there was in terms of story and progression, and that was awesome.
Overall that Gen was such a massive step up from gens VI-VIII, I can’t help but love it.