Edwin Diaz after giving up a three-run home run to...

Edwin Diaz after giving up a three-run home run to Jean Segura in the ninth inning on Thursday in Philadelphia. The homer gave the Phillies a 5-3 victory. Credit: AP/Matt Slocum

Mickey Callaway said issues with Edwin Diaz’s mechanics have led to his struggles this season and that even though he has worked to rectify them, he reverted to type during Thursday’s meltdown against the Phillies.

Diaz allowed a career-high five runs and a career high-tying two homers in the ninth inning for his fourth blown save of the year — matching last year’s total.

“We’ve looked into it deeply and [the issues he’s had is] not every game,” Callaway said. “It’s really about location and sometimes his delivery gets a little bit out of whack. They talked about it a week ago and he was really excited about it. He was able to change it for a couple outings and then it reverted back.’’

When he struggles, Diaz gets across his body during his delivery and tends to catch too much of the plate. “When he’s right,’’ Callaway said, “he’s the same guy he was last year.”

Cano still batting third

Callaway said he has considered moving struggling Robinson Cano down in the order but that what he sees as recent improvements tells him to keep the second baseman where he is. Cano, who batted between Pete Alonso and Michael Conforto on Friday night, brought a .222 average into the game and hit .135 during the 11-game road trip. He went 2-for-4 in the Mets' 6-2 loss to the Braves.

Callaway said he and hitting coach Chili Davis “felt like [Cano has] put the barrel to the ball lately, and we feel like at least for today, that the three-hole is going to be a good spot for him. We’ve had some success scoring runs very recently in that spot, in between those guys. I like how our lineup is right now. I think our offense has been performing really well.”

Cano has a career-low .262 BABIP. Said Callaway, “We need to get him going.”

Mets sign pitcher Allan

The Mets signed their third-round draft pick, pitcher Matt Allan. The bonus is for $2.5 million, according to Jim Callis of MLB Pipeline, making it the third-highest bonus for any third-round pick. Pipeline had Allan as the highest-rated high school pitcher in the draft.

“He is a tremendous high school talent,” Brodie Van Wagenen said. “He’s someone we manipulated our entire draft to bring into the organization . . . This pitcher has a chance to be a No. 1 or No. 2 starter. An opportunity like that doesn’t present itself very often.”

Extra bases

Jeurys Familia was perfect in 1 1/3 innings during his rehab stint with the Brooklyn Cyclones. He struck out two and threw 13 pitches, 10 for strikes.