For weeks, the Miami Heat could not win when they had to.

Wednesday night, they could not lose when they needed to.

But this time, for a rare time this season, fate was on their side.

On a bizarre night when defeat was the best opportunity for immediate gain, the Heat reached to the depths of their roster to field a lineup . . . that still was good enough to defeat the Philadelphia 76ers 105-101 Wednesday night at Wells Fargo Center.

With a loss, the Heat would automatically assured themselves of the No. 10 seed in the May 19 random-but-weighted NBA Draft lottery, and a 91-percent chance of retaining that selection.

But the team that would benefit the most by a Heat victory, the team that would receive that Heat first-round pick if it is not among the first 10 in the June 25 NBA Draft was, you guessed it . . . these very same 76ers.

In the end, though, the Heat result proved moot, with the Brooklyn Nets defeating the visiting Orlando Magic in a game played simultaneously, thereby preventing the possibility of the Heat falling into a tie for that No. 10 lottery seed.

"At least I didn’t have to stress out and kill myself over the result," said Heat coach Erik Spoelstra, who learned of the Nets' victory while his own game still was in the balance.

"It's the worst position to be in as a coach and competitor."

Spoelstra tried to cook the books the best he could.

No Dwyane Wade. No Goran Dragic. No Luol Deng. No Hassan Whiteside. Not even Birdman or Chalmers.

Instead, there was a starting lineup of Zoran Dragic, Tyler Johnson, Michael Beasley, Henry Walker and James Ennis left to swim or, preferably, sink.

Or simply run out of gas. All but Zoran Dragic played all 48 minutes, and he played 41.