MIAMI GARDENS, Fla. — For four straight games, Jim Schwartz’s defense held opposing offenses to 17 points or less. His unit might have had favorable draws against quarterbacks Josh Allen and Mitchell Trubisky in victories over the Bills and Bears, but few could downplay its performance vs. Tom Brady and Russell Wilson.

The Eagles would ultimately lose to Brady’s Patriots and Wilson’s Seahawks, but if they had any hope of catching the Cowboys in the NFC East, it would surely be behind a resurgent defense. If Brady and Wilson couldn’t decode Schwartz’s scheme, Ryan Fitzpatrick and a woeful Dolphins offense would have zero chance.

Right?

Wrong.

The Eagles season got even weirder Sunday when the Dolphins, who entered with an NFL-worst minus-183 point differential, torched Schwartz’s defense for over 400 yards in a remarkable 37-31 win at Hard Rock Stadium.

Whatever goodwill the defensive coordinator had earned over the last month vanished in a span of about two hours as Fitzpatrick and the Dolphins marched up and down the field on the Eagles, particularly their pass defense.

Trailing, 10-0, late in the first quarter, the Miami offense would go — aside from a Fitzpatrick one-play kneel before the half — touchdown, touchdown, touchdown, touchdown, touchdown, field goal in six successive drives.

The Eagles often countered the scores with their own, and even took a 28-14 lead early in the third quarter. But when quarterback Carson Wentz and the offense stalled in the second half, Schwartz’s group could do nothing to stop the bleeding.

Fitzpatrick and first-time offensive coordinator Chad O’Shea were one step ahead of Schwartz for most of the day. The 37-year-old journeyman quarterback has had the defensive coordinator’s number in his career.

He’s now 4-0 as a starter vs. Schwartz’s defenses, having completed 68.4% of his passes for an average of 295.3 yards, with nine touchdowns against four interceptions (106.1 passer rating) in those games. While Fitzpatrick is still in the NFL for a reason, it should be noted that he has a career 52-81-1 record as a starter and an 80.9 rating overall.

Schwartz, of course, doesn’t meet with reporters after games. He prefers that Doug Pederson speak for the team. But the Eagles coach has little involvement on the defensive side. Schwartz has autonomy and significant sway in personnel. Answers to questions about why he couldn’t counter the Dolphins’ adjustments will just have to wait a couple of days.

When O’Shea figured out that the Dolphins couldn’t run, and that the Eagles’ pass defense was susceptible, especially cornerbacks Jalen Mills and Ronald Darby, he had Fitzpatrick drop to throw on nearly every play, often with an empty backfield.

“They did a good job of adjusting. They started going to more empty sets,” Eagles safety Malcolm Jenkins said. “Getting the ball out quick, so we couldn’t really pressure them. And when they did want to take shots down the field, they did a good job protecting up or giving them max-up [protection] looks.”

Jenkins and fellow safety Rodney McLeod said that the Eagles adjusted their coverage at times to account for DeVante Parker, who had caught a 43-yard touchdown and a 42-yard pass in the first half. There was a period when the receiver wasn’t targeted much. But Fitzpatrick took advantage of one-on-ones vs. tight end Mike Gesicki and unheralded rookie running back Patrick Laird.

The Eagles defense, which had forced a turnover (a Darby interception) on the Dolphins’ first drive, and sacked Fitzpatrick three times before the break, generated little pressure. Quick hitters frustrated the four-man rush. And when Schwartz blitzed, his extra rushers hardly got home.

Darby got beat on a couple of deep passes where you just had to tip your cap to Fitzpatrick and Parker (7 catches for 159 yards and two touchdowns). But Mills’ day was forgettable. He got flagged for two pass interference penalties — the first by way of a Miami challenge — and kept getting victimized vs. jump balls to bigger receivers.

It had gotten so bad that few would have blinked an eye if Schwartz had pulled Mills for a rangier cornerback like Rasul Douglas.

“The biggest word is execute,” Mills said.

The game plan wasn’t exotic, per Jenkins. Maybe it needed to be. Fitzpatrick was on another team, surrounded with much better talent, when he last faced the Eagles a year ago with the Buccaneers. But he torched Schwartz’s secondary for 402 passing yards and four touchdowns.

But the coordinator often had his corners on islands, per usual, and Fitzpatrick went at them down the field.

“I think we tired them out a little bit,” Fitzpatrick said, “just being able to sustain some drives and not have some three-and-outs or some quicker series.”

Jenkins said the climate change — it was 82 degrees at kickoff — had nothing to do with the defensive struggles.

“I don’t give a [bleep] about the climate,” Jenkins said.

The Dolphins had nothing to lose and played like it, and those can be dangerous teams. They scored a touchdown with great design and execution on a trick play near the goal line. They converted three fourth downs. They played as if they were the team with a division lead and the playoffs at stake.

The Eagles, meanwhile, can’t seem to deliver a complete product on a weekly basis. When the defense is good, the offense stinks. When the offense finally scores points, the defense can’t stop the wind.

Jenkins said Eagles leaders won’t allow for finger pointing, but there have already been breaches this season with anonymous quotes to reporters. There was a players-only meeting after the Cowboys loss a month ago that seemed to turn things around, but Jenkins said he won’t sanction another.

“You don’t want to be Captain Obvious,” Jenkins said. “We didn’t [bleeping] play well. We know that. There’s no need to beat a dead horse.”

The NFL is a week-to-week entity. The reversal of Schwartz’s defense is evidence of that. But the Eagles’ season may be a beaten corpse.