...except that the guy the heroes found was really a bad guy and this whole thing was a setup to get him in with the heroes, but fortunately someone reveals what's going on to the heroes moments before the bad guy tricks the heroes into making a mess of things.
Alternatively, the heroes think they're pulling a dramatic rescue, but the villain informs them he already executed his partner 35 minutes ago. The heroes then proceed to reveal they had already rescued the partner but tricked the guards into thinking he'd been executed; when the villain emerged to gloat, it gave the heroes the opening they needed.
The Big Damn Heroes are rescued by Bigger Damn Heroes during their botched Big Damn Rescue.
The Big Damn Heroes arrive too early, then leave and come back again just in the nick of time.
Zig Zagged: There are so many consecutive B.D.H moments that you aren't sure who's the hero, who's the near-victim, and who's the bad guy.
Averted: The Heroes save the guy several days before his scheduled execution.
Enforced: The writers find the trope to be cliched and want to avert it, but the editors demand they use it for dramatic purposes.
The condemned laughs as his sentence is about to carried out because he knows his allies will rescue him.
Alternatively: "What the hell took you so long?!"
Invoked: The Heroes purposely wait until the last moment because they know that's how these stories go.