I agree with the people who've said it can be thematically appropriate!
I never watched either of the Avatar cartoons myself (I KNOW, SHAME ON ME), but I saw really different reactions from my friends to the ending of A:tLA and the ending of LoK's first season. Both involved the hero using a previously unknown ability that saved the day (AT LEAST THIS IS MY UNDERSTANDING), but it seemed like, in A:tLA, it was something that the story built towards, it was the answer to the thing Aang had been struggling with, so people accepted it. Whereas in LoK, it was something that let her avoid a struggle that frightened her. The story built towards a conflict that this power let her dodge, and that was less satisfying.
I can't say for myself, but that makes a lot of sense to me, conceptually. What the story is building towards makes a big difference.
There was a book I read when I was younger about foxes who lived in a valley that was going to be flooded by a human-built dam. Their elder, a blind fox who lives in the mountain, tells them not to worry about it, but they fear he doesn't fully understand their situation and try to find a solution. In the end, the animals all band together to try to sabotage the dam. It's an inspiring moment that's ultimately futile, as the humans' machinery can undo the work of the animals in minutes, and the animals give up, and try to escape the valley.
Once the dam is completed, and water is supposed to rush into the valley -- it never does. There were underground caverns in the mountain all this time, and the water simply rushes into them and never fills the valley, never touches the foxes' home. It's mentioned that the blind fox would've known they were safe from the beginning; he could hear the water running in the caverns under his home.
They're saved by a miracle, but I liked the story a LOT -- obviously, I remember it to this day. There was something spiritually powerful about that theme to me, the idea of needing to trust even when things seem life-threatening, the idea that the animals' frantic panicking came to nothing, because they were already being cared for. It felt like the point of the story rather than a failing.
So I guess that's ultimately the thing? Like, maybe the stories where Deus Ex Machina feels RIGHT are the stories where it's the point, where the miracle is the answer to the thematic questions that the story is asking, rather than a way to dodge those questions? and the stories where it's unsatisfying are the ones where the story asks interesting questions that it doesn't have the guts to answer, or that it has no answer to, so it throws in a miracle instead.
I .......THINK I'M JUST REPEATING KEIIII HERE SO UH, I AGREE WITH HER. xD
I dunno! Really interesting to ponder. We always think of Deus Ex Machina as a universally bad device, but it's interesting to think about the times when it seems to be the right answer.