Stagnating doesn't begin to cover it when 500 million consoles were sold in the 7th generation, the 8th fell to under 300 million, and the 9th will probably only match that number just because of the Switch and the pandemic.
There are a lot of culprits here: market consolidation around a number of evergreen titles (Fortnite, GTA, some Nintendo franchises, other GAAS, etc.), the younger generations going for shorter and more immediate endorphin releases like TikTok, competition from smartphones, and so on.
It's possible this is a problem with no market solution just like there was no market solution for pure handhelds and arcades. On the other hand, maybe generative AI will rein in the ballooning developing costs for whoever is still buying dedicated consoles a decade from now.