The coach is almost always the one to go, and so it is that offensive line coach Juan Castillo has been fired by Buffalo Bills coach Sean McDermott following a season in which Castillo’s group performed at an absurdly low level.

Very often it’s not the assistant coach’s fault, and in this case, Castillo was tasked with trying to meld a unit that lacked talent and/or experience all the way across the line of scrimmage, much of that related to Castillo losing left tackle Cordy Glenn, left guard Richie Incognito and center Eric Wood between the end of 2017 and the start of 2018.

When McDermott was asked about the play of the line during his season-ending press conference Monday, he said, “There were sometimes in the game, in particular yesterday (against Miami), where I thought we played well. There were some other times throughout the season where I didn’t think we played well enough. We were out of sync up front. As you’ve heard me say before, the game is won or lost up front. We did a good job in winning the line of scrimmage on both sides yesterday, but not enough throughout the season, in particular, on the offensive side. That’s an area that we have to look hard at this off-season.”

Castillo, who just completed his 24th year as an NFL coach, joined the Bills in 2017 when McDermott hired him for his first Bills staff. The two men worked together in Philadelphia for nine years (2003-11), McDermott in a variety of positions, the highest of which was defensive coordinator, while Castillo was the offensive line coach from 1998-2010.

Oddly, when McDermott was fired following the 2011 season, Castillo switched sides of the ball and moved over to fill his position on Andy Reid’s staff in 2011. Based on their history, on a personal level this was likely a difficult call for McDermott to make, but the results on the field provided a viable reason for the firing.

Free agent center Russell Bodine, his backup, Ryan Groy, plus opening day starters John Miller at right guard and Jordan Mills at right tackle, were among the worst starters in the league at their positions. On the other side, left guard Vlad Ducasse was benched at midseason and replaced by rookie fifth-round pick Wyatt Teller, and left tackle Dion Dawkins clearly regressed in his second season.

That, perhaps more than anything else, is why Castillo was sent packing. Dawkins showed great promise as a rookie second-round pick in 2017 as he played most of the year in place of the oft-injured Glenn.

The Bills felt confident enough in Dawkins heading into 2018 that they traded Glenn to the Bengals prior to the draft, part of their process in moving up in the first round to procure one of the quarterbacks, which turned out to be Josh Allen.

Now, there is some speculation that the Bills, depending on how free agency and the draft play out, could flip Dawkins over to the right tackle spot because Mills is a free agent who isn’t likely to return. Groy and Miller are also free agents.

“I’m not going to slot anybody in,” general manager Brandon Beane said Monday when asked about Dawkins. “Sean and Brian (Daboll) would do that. We’re going to put guys in the best spot to succeed. We’ll bring in competition from free agency, draft, at a lot of spots, including O-line. If we feel Dion is our best left tackle, then that’s where he’ll play.”

Dawkins struggled much of the year, and one of his biggest issues was penalties. He was flagged 14 times — four false starts, four holds, three unnecessary roughness, one ineligible man downfield, one illegal formation and one chop block — with 11 of those being accepted for a total of 91 yards. His number of penalties and yardage both led the team.

Mills ranked second with eight penalties, seven of which were accepted for 52 yards. Teller (five), Miller (four) and Ducasse (four) all ranked in the top six on the team.

For the season, the Bills tied for fifth-most in the NFL with 116 penalties, and the offensive line was called for 45 of the infractions, 38 of which were accepted for 295 yards. The next highest position group was the defensive backfield, which had 22 penalties (19 accepted for 278 yards).

If you believe in the grading system of analytics site Pro Football Focus, Dawkins ranked 38th among all NFL tackles with a 69.2 grade on a scale of 100 (Green Bay’s David Bakhtiari was No. 1 at 88.3), while Mills ranked 72nd at 56.1.

At guard, Miller ranked 25th at 64.4 (New England’s Shaq Mason was No. 1 at 82.1), Teller was 55th at 55.5, and Ducasse was 68th at 49.8.

And at center, Bodine was 19th at 61.8 (Philadelphia’s Jason Kelce topped the list at 84.9) and Groy was 35th at 46.7.

Another analytics site, Football Outsiders, used its adjusted line yards metric to determine the Bills’ line was third-worst in the NFL.

Looking ahead:Buffalo Bills: 10 things to watch for before the 2019 season kicks off

Bright future:Sean McDermott and Brandon Beane believe the Bills are heading in right direction

One more year:Lorenzo Alexander wants to return to Bills for 2019 season

Not to make your head explode, but basically, Football Outsiders takes all running back rushing attempts and assigns responsibility to the offensive line based on the following percentages: Yardage losses at 120 percent value, 0-4-yard gains at 100 percent value, 5-10-yards gains at 50 percent and 11-plus yards at 0 percent. The numbers are then adjusted by down, distance, situation, etc.

It’s a long-winded way of saying the Bills’ line was pretty terrible, and that is clearly reflected in the 20.9 percent of running back carries that were stuffed, meaning zero or negative yardage. That figure ranked 23rd in the NFL.

FO also ranked the Bills 23rd in adjusted sack rate at 8.0 percent, with the Patriots No. 1 at 3.8 percent and the Texans dead last at 11.5 percent.

MAIORANA@Gannett.com