MIAMI GARDENS, Fla. — With the return of their two starting cornerbacks, Ronald Darby and Jalen Mills, in late October, the worst finally appeared to be over for the Eagles’ defense.

A weakness started to look a little bit like a strength. Jim Schwartz’s unit held four straight teams to 17 points or fewer. It held the opposing quarterbacks in those four games, including the great Tom Brady and league-MVP candidate Russell Wilson, to a 70.6 passer rating, including a 51.6 completion percentage and just 5.7 yards per attempt.

Then Sunday happened.

Darby and Mills, who both will be free agents after the season, played poorly in an unexpected 37-31 loss to the Miami Dolphins that dropped the Eagles to 5-7.

“I felt horrible,’’ said Darby. “It was one of my worst performances.’’

Said Mills: “I pride myself on playing a lot better than I did today. I didn’t.’’

Darby and Mills were unable to stop Dolphins quarterback Ryan Fitzpatrick and wide receiver DeVante Parker. Fitzpatrick, who threw for 402 yards and four touchdowns against the Eagles last year when he was with the Tampa Bay Bucs, passed for 365 yards and three touchdowns Sunday.

The 6-3, 216-pound Parker was targeted 10 times by Fitzpatrick, and had seven catches for 159 yards and two touchdowns.

“He’s a good player, Eagles coach Doug Pederson said of Parker. “I mean, he’s a good player.

“Our guys were in position. They’ll take a look at the tape and see what they could’ve done better. But credit their quarterback and receiver for making those plays. They did it.’’

Darby actually intercepted the first pass Fitzpatrick threw Sunday, a throw over the middle for Parker, who ran into linebacker Kamu Grugier-Hill on the play.

Darby’s interception set up a short 18-yard touchdown drive that gave the Eagles an early lead.

But that was one the only things that went right for Darby or Mills.

Darby had good coverage on Parker on a deep sideline route later in the first quarter, but Fitzpatrick threw a perfect pass over his outstretched arms and Parker caught it and was able to escape and make it to the end zone for a 44-yard touchdown.

On the Dolphins’ next possession, Darby again got beat by Parker for a 43-yard completion on a third-and-13 that kept alive yet another Dolphins touchdown drive. A third-and-10 pass interference penalty on Mills on a fade to Parker also kept that drive alive.

The third quarter ended up being Mills’ personal version of hell. He seemed to momentarily lose his footing and gave up a 17-yard touchdown pass to Parker that made it a 28-20 game. Then, on the Dolphins’ next possession, he let tight end Mike Gesicki get behind him in the end zone. Fitzpatrick lofted a perfect pass to Gesicki for a 14-yard score.

“He had a day,’’ Mills said of Parker. “He’s an NFL receiver. Everybody has a day. He had one today.’’

He wasn’t done. On a Dolphins touchdown drive early in the fourth quarter that gave them a 34-28 lead, he caught an eight-yard pass on Darby, then caught a 34-yard pass from Fitzpatrick against Mills that gave the Dolphins a first down at the Philadelphia 15. They scored three plays later.

On the Dolphins’ final scoring drive, Parker caught an eight-yard slant in front of Darby on a fourth-and-one play.

“This is an on-any-given-Sunday league,’’ said Mills. “The biggest word is execute. Whenever your number is called, just make the play.

“We stuck to the game plan we’ve had this whole year. It wasn’t nothing we switched up. Nothing different. The biggest word was execute.’’

Last week, the Eagles held Wilson to 200 yards and one touchdown. But there were some noticeable cracks in the performance. Wilson had his tight end wide-open in the end zone and missed him. Rookie wide receiver D.K. Metcalf dropped a couple of deep balls, including one that would’ve been a touchdown.

“Every game I feel like we’re going to go out there and fly around and have fun,’’ said Darby, who also had an interception against the Seahawks. “Even when I gave up a play early and they scored, you still gotta go out there and make plays.’’

“That’s the NFL. You’re not going to be perfect all the time. It’s how you bounce back from it.’’

So, in his last two starts against the Eagles, a 37-year-old journeyman quarterback has thrown for nearly 800 yards and seven touchdowns.

“It’s disappointing,’’ safety Rodney McLeod said. “We felt confident going into this game. We knew what was at stake. And we failed to do that today. As a defense, and that’s all I can speak on, we just didn’t play our best ball.

“We just let the game get away from us. We didn’t finish.’’

It’s not just the season that’s on the line for Darby and Mills. It’s also their immediate futures. There appeared to be a pretty good chance that the Eagles would attempt to re-sign at least one of them after the season, and maybe both.

But general manager Howie Roseman has to be having his doubts after the way the two of them played against the Dolphins. Yes, Parker is a very good receiver. But there are a lot of good receivers in the league. And you need corners that can shut them down.

It’s frustrating letting a game like this get away from you,’’ said McLeod, who also will be a free agent after the season. “You have to show up each and every Sunday, regardless of a team’s record. That’s what we knew. We came out with energy. We had the interception (by Darby) on the first play. We had a solid first half of ball.

“Second half, we came out up two touchdowns and kind of let our guard slip down a little bit. They made a lot of plays.’’

Said Darby: “We have to come back ready to work next week.’’