MIAMI -- After scoring the fourth-most runs in the National League in the abbreviated 2020 season, the Phillies ran back the lineup this year and finished with a middle-of-the-pack offense.

The result: Hitting coach Joe Dillon lost his job.

Dillon and infield coach Juan Castro were let go Sunday before the season finale here against the Miami Marlins, Phillies manager Joe Girardi said. Assistant hitting coach Pedro Guerrero was given permission to look for a job elsewhere. Girardi said the rest of the staff, including first-year pitching coach Caleb Cotham, will return next season.

“I think they worked extremely hard, but we just felt at this time it was time to make some changes,” Girardi said of Dillon and Castro, both of whom were on the major-league coaching staff for two seasons. “We always talk about, at this level, it’s a production-based business. It’s difficult.”

Dillon came to the Phillies after two seasons as the Washington Nationals’ assistant hitting coach under Kevin Long, Girardi’s hitting coach for several years with the New York Yankees. Dillon also had a preexisting relationship with Bryce Harper, and Harper had the second-highest on-base-plus-slugging (1.017) in the majors over the last two seasons among hitters with at least 400 plate appearances, including a 1.039 mark entering play Sunday.

But most of the Phillies’ regulars had a lower OPS this year than last. Young third baseman Alec Bohm regressed at the plate; veteran shortstop Didi Gregorius had the worst year of his career. As a team, the Phillies cut their strikeout rate from 27.2% in April and May to 20.9% thereafter. But they ranked seventh in the NL in runs (730), home runs (196), and on-base percentage (.318), eighth in slugging (.408), and 10th in hits (1,280) through Saturday night’s game. They had the lowest batting average in baseball against fastballs (.244).

For a team that was built to slug, the Phillies were too inconsistent. In a text message Sunday, Dillon said he understood someone had to take the fall and wished the team well.

“Expectations weren’t met, and I’ll take full responsibility for that,” Dillon said. “I gave everyone in that clubhouse everything I had, and I’ll stand behind all the work Pedro Guerrero, [scouting coordinator] Josh Studnitzer and I did the last two years.”

Said Harper: “I thought working with him every day personally was really good for me. But as an offense, I don’t think we did our job enough to really warrant anybody’s success. It’s part of the business side of the game. It’s part of the process if you’re not winning, if you’re not doing well.”

» READ MORE: Phillies’ offseason to-do list: Help Bryce Harper, upgrade infield, and go deep on pitching | Scott Lauber

In the next hitting coach, Girardi said he will look for “a combination of everything,” from traditional coaching techniques, to an understanding of data and analytics. But the Phillies sought a similar blend when they landed on Dillon two years ago. In an age when most players have personal swing coaches, the job of a major-league hitting coach has only gotten more difficult.

“I think it’s keeping them on track and making adjustments,” Girardi said. “I think approach is important. Combating what [pitchers] are doing to you is probably the most important thing that you can do as a hitter. You have to adjust always in this game because they’re adjusting to you. And who helps you make those adjustments the quickest? That’s what we’re looking for.”

Castro, a 17-year former major-league infielder, was charged with improving a Phillies infield that wasn’t expected to be a strength. Bohm, Gregorius, and Rhys Hoskins are below-average defenders at their positions. Sure enough, Hoskins saved six fewer runs than average at first base, while Gregorius saved 10 less than the average shortstop and Bohm 11 less than the average third baseman.

In spring training, Castro emphasized a better pre-pitch setup for the infielders. Midway through the season, Gregorius said he reverted to what he had done in the past.

“They wanted me to do some presets that weren’t working for me, so I told them I’m done with that and went back to my old ways,” Gregorius said in July. “Just one step and get ready. Before, I was trying to jump and I was always out of rhythm.”

It raises the question of how much an infield coach can do to improve a 31-year-old shortstop’s range or a third baseman’s first step.

“You challenge the players to invest in their training, quickness and first step, and the anticipation,” Girardi said. “You challenge them to get after that this winter. Now, the players are responsible to do that, and if they don’t, then usually you don’t see the improvement.

“Overall, defensively, we have to get better. I believe that our defense cost us games this year. I think that range and ball securement is really important, and those will be things that we continue to try to tackle and accomplish.”

» READ MORE: As Héctor Neris closes in on a strikeout milestone, he reflects on a Phillies career that may be nearing an end

Girardi said Friday that the Phillies haven’t told Bohm to prepare for a position change next year. Gregorius is under contract for $15.25 million in 2022 and lacks trade value coming off a dismal year. It’s difficult to imagine the left side of the infield looking the same next year.

But if it does, Bohm and Gregorius will be coached by someone new.

“Regarding what happened, I really don’t know,” Castro said by text. “Just the thinking to go a different route on the infield coach. Nothing but thanks to the organization for the opportunity.”