What was Rob Gronkowski doing out there? (Michael Reaves/Getty Images)

The Miami Dolphins’ last-second, double-lateral, walk-off miracle touchdown Sunday afternoon knocked viewers off their couches, unleashed a torrent of indecipherable shrieks and stunned both poles of the Eastern Seaboard. It was a play that happens once or twice every couple of decades. After the initial shock wore off, another reality started to set in, one nearly as shocking and rare as the play itself.

Bill Belichick screwed up the end of the game. Completely botched it. In more ways than one.

The Dolphins’ execution was sublime, but they received help from Belichick’s decision on the final play and what led to it. The obvious mistake Belichick made was to insert tight end Rob Gronkowski as the deepest defender on the play. It was a thoughtless error, a rote concession to routine, the kind of botch Belichick never makes.

Gronkowski has for years been the Patriots’ last line of defense against Hail Mary passes. His height and physicality makes Gronkowski ideal for the role. But the Dolphins’ snapped the final play from the Miami 31-yard line with seven seconds left. To believe Miami would run a Hail Mary, you’d have to believe the Dolphins would trust quarterback Ryan Tannehill to throw a pass 75 yards in the air. Miami’s only choice, it should have been obvious, was to run some of kind lateral-heavy play.

Gronkowski’s presence was not only unnecessary. It was detrimental. The Patriots’ final defender should have been their fastest player who is also a sure tackler. When Kenyan Drake bolted through the Patriots’ secondary, Gronkowski stumbled, lost any angle to chase him and watched helplessly as Drake sped into the end zone. But you couldn’t blame Gronkowski. You could only blame Belichick for putting him out there.

Review the final play closer, and another curious tactical choice by Belichick sticks out. Linebacker Kyle Van Noy lines up on the right side of the line and, rather than pressure Tannehill, drops back and spies him. On a Hail Mary, that might be an effective move — it would keep the quarterback from escaping the pocket and buying time. But on a play with multiple laterals, it would basically force the Patriots to play with 10 defenders.

Van Noy hustled back into the play, but he couldn’t recover. He was right behind Kenyan Drake when Drake caught DeVante Parker’s lateral at the Miami 48. At the Patriots' 43, Van Noy dives for Drake’s ankles and comes up just short. Had Van Noy simply dropped into coverage rather than pointlessly hovering around the line of scrimmage, he may have made the disaster-saving tackle or otherwise help the play stall.

The Patriots could have prevented Miami from running the play at all had Belichick chosen a better endgame strategy. The Patriots led by two points and faced fourth and goal at the Miami 4-yard line with 21 seconds left. Miami had used all of its timeouts. Belichick chose to kick a field goal, which served the purpose of putting the Patriots up by more than a field goal.

But what the Patriots should have done is tried to score a touchdown. Converting the field goal and then kicking off left the Dolphins one play to score a touchdown from 69 yards away, with no opportunity to completely seal the game. Had the Patriots gone for the touchdown on fourth down but failed, it would have left the Dolphins about 15 seconds — three plays at most — to move 60 yards with no timeouts to kick an extremely long field goal: a very unlikely proposition. And if the Patriots scored the touchdown, the game would have been over, period.

Either choice would have left the Dolphins about a 1 percent shot to win. Miami needed a miracle. But trying for a touchdown at least would have given the Patriots a chance to dial that percentage to zero.

No matter what choices Belichick made in the final seconds, the Dolphins needed a combination of perfect execution and divine intervention. Tannehill made a great throw. Kenny Stills made an acrobatic catch, showed patience in setting up a lateral and made a perfect pitch. Parker made a quick, well-placed pitch. Drake flashed immense speed and great instincts in weaving laterally through the defense before sprinting down the right sideline. The Dolphins were perfect.

But they still shouldn’t have been able to pull it off. Belichick, maybe the greatest coach of all time, enabled one of the greatest plays of all time. The loss prevented New England from clinching the AFC East and could prove critical in the Patriots' chances of earning home-field advantage and/or a first-round bye. The shock will not wear off any time soon.

Read more from The Post:

Josh Johnson will start Redskins’ next game after leading two touchdown drives vs. Giants

Another wondrous game from Patrick Mahomes has Chiefs looking good for AFC’s No. 1 seed

Cowboys Coach Jason Garrett reportedly wants ESPN’s Jason Witten back on the field

West Virginia quarterback Will Grier will skip bowl game to focus on NFL draft

Forget the NFL. Heisman winner Kyler Murray will play baseball, agent Scott Boras says