PHILADELPHIA — It didn’t matter that Yu Darvish pitched like the ace of the staff or that Anthony Rizzo homered or that the Cubs had a five-run lead in the eighth inning.

What mattered on this night was that three grounders went off middle infielders’ gloves in the ninth inning and that $330 million Bryce Harper got a chance with the bases loaded against $1 Cubs acquisition Derek Holland in the ninth.

Do the math. Should have plenty of time before Harper’s walk-off grand slam returns from the clouds over Philadelphia.

“That one is going to leave a mark,” manager Joe Maddon said.

What might be the most crushing loss — a 7-5 gut punch — in a season of constant road breakdowns gave the Phillies a three-game sweep and ruined a chance for the Cubs to overtake the Cardinals for sole possession of first place in the National League Central.

“It’s No. 1 for sure,” said Rizzo, who batted leadoff because of a lineup shuffle caused by the late scratch of Javy Baez (flu). “With the road struggles, being able to win a game here would’ve been nice going into Pittsburgh.

‘‘It’s definitely tougher at this point in the season as opposed to April and May.’’

When Baez’s replacement at short, David Bote, lost a one-out hopper off the heel of his glove to open the Phillies’ rally, it was easy to blame the flu bug going around the clubhouse in recent weeks, along with Bote.

And when four relievers couldn’t close out a 5-0 lead with six outs to go after Darvish’s seven-inning gem, it was easy to blame a series of injuries that had three of the bullpen’s top late-inning relievers sidelined Thursday, along with Kyle Ryan in the eighth and Pedro Strop and Co. in the ninth.

But almost six months after a winter of fiscal austerity and “urgency,” all the bargain hunting and delays in filling roster needs are biting the Cubs even harder in the back end of their bullpen and rear flanks of their bench depth.

The closer they added midseason is out with a sore knee until at least Saturday. Their best-performing setup man is out until Friday because of a pectoral injury.

Forget the injuries. By the time the Cubs got to August, after a flurry of mostly deck-chair moves at the trade deadline, they had little breathing room and no margin in the tightly packed NL Central.

And by the time Strop hit Rhys Hoskins with the pitch that loaded the bases for Harper, it was too late to rewind and go with David Phelps instead. And only Holland remained for a matchup call on the lefty — a veteran left-hander who has spent most of his career making 221 starts.

“It’s no excuse, though. You can’t use that,” said Holland, who had faced Harper twice before without allowing a hit. “I’ve been in these situations before. I’ve come out of the pen before. I made the pitch I wanted to make. It was a [96 mph] fastball in. It was off the plate in, and he turned on it, and he got it.”

Maybe that’s just where this team is. And what it is.

Good. But not good enough often enough.

Flawed. Depleted. Incomplete.

They lost five of seven this season to the Phillies, who are nobody’s pennant favorites and trail the Cubs by one game for the second wild-card spot.

They never fixed the offense that “broke” last year. They never got the bullpen right. They’re not close to the defensive team they have been in recent years.

“We have confidence in all of our guys,” said Rizzo, whose home run in the third inning was his first since July 27. “I know we’re banged up. But this is our team. It’s a good group.”