It seems to me like it is a pendulum swing. It used to be that most works were straightforward and heroic, so that when someone had the idea to write a morally gray story, that was fresh and really interesting. Eventually everyone, tired of the worn out heroic tropes, started to get on this dark, edgy bandwagon. But now the dark and edgy stories are just as worn out as heroic stories used to be. Now, a straightforwardly heroic story is actually kind of subversive and fresh! So I think that, over the coming decades, we will see a shift back towards optimistic stories as people get more and more tired of the dark and gritty kind.
That’s a great point, though I would add the caveat that I do find moral complexity interesting. But that doesn’t require grey or outright antiheroes. A hero can be complex, or can be someone who was once more grey or even a villain and it’s a redemption arc.