I like a lot of the responses in this thread, but I’ll add my two cents.
Just because an ending doesn’t invoke Deus Ex Machina, it doesn’t mean that ending is satisfying, or that you should expect people to accept “well, it was foreshadowed in the beginning.” People forget a lot of things and if they aren’t primed for the reveal, they will feel cheated.
Case in point: CLANNAD. I love this game to death, but even though the orbs of light were foreshadowed throughout the game/series, nobody expected the orbs of light to bring Nagisa back from the death. This reveal ultimately appears as a plot twist (even though you can argue it isn’t) and since they weren’t expecting it or didn’t have the orbs in the forefront of their mind, they might feel cheated. Specifically, the viewers had absolutely no reason to suspect that Nagisa’s life/death status was tied to the orbs of life.
It makes sense within the narrative. The “need” for the orbs of light didn’t appear until Ushio died. It would be a different story if, say, Tomoya kept wishing for the resolution of his problems, and at the end of the story, his wish was granted. But that isn’t the case. The “trigger” for the light orbs activating doesn’t actually happen until the absolute end of the narrative. There was no way to prime people that “hey, remember those orbs of light? They might be important soon.”
This is all about viewer expectations. You can logically invoke Chekhov’s gun and say “well, that thing at the beginning of the movie? You were supposed to guess that it would be used at the ending” but sticking a few hints in the narrative without context of their use does not necessarily free you from “an unsatisfying ending.”
TL;DR: I think, to be concise, I’d recite some writing advice I received a few years ago: “the ending should be surprising, but inevitable.” The trajectory of the entire story should lead up to that ending. You can say “well, it was foreshadowed” all you want, but that doesn’t mean the ending was “inevitable.” You can use this argument against CLANNAD: there is no reason to expect that Nagisa would be brought back to life, since the latter half of After Story focused on Tomoya’s recovery and also in Little Busters!: there is no reason to expect the Little Busters to live, considering that the entirety of Refrain focused on Riki and Rin “moving past” everyone’s deaths. Like yeah, KEY had their bases covered, but does that make it satisfying? Your mileage may vary. (Neither of those bothered me at all, but I know people that really had problems)
Sorry for rambling, but hopefully I got my point across