When was a time you got "saved by the bell" in real life?

(Basically a situation where you were set up for failure but against all odds you got lucky)