As mentioned, when it comes to "miracles", it's very perception based. As the writer, we know what's coming and we have all the materials to explain things. But, to some readers, they'll call it "convenience", "plot armor", or as you mentioned a "miracle". They'll see the sudden change in direction as a poor excuse to rescue the damned. If you fail to setup your escape, of course.
So long as your miracle has proper meaning, fits in the story, and isn't well and truly a bullshit excuse for your MC/Character to survive what is well and truly their death flag- it's not plot armor. Convenient, sure, as timing is certainly everything and mere seconds make a difference in actual combat. A miracle though? No.
Miracles are bullshit. Convenience is timing. And both are things readers hate- but fuck them. Honestly. Nothing goes perfectly. "No plan survives contact with the enemy". And in reality, most life and death scenarios are survived because people perform random bullshit and pull it off. Look to most Soldiers in wars- they fucking wing it and hope for the best. Succeed and you get a medal. Fail and, well, you get a box and some quiet time alone with your thoughts.
If I need something to happen and I've got my MC in a hole, I'm going to write him out of it. It's going to happen unless it's planned for him to die. But, once again, keep it within the rules of your world. Have you foreshadowed the assistance/growth spurt? Is there a side character that you can properly explain for being there? Does your MC have a trick up their sleeve you've been hiding?
No miracle is "earned", but it certainly can be created carefully.