An error on the baseball diamond can cost a team a game, even a championship.

But an error (or errors?) in the construction of Carolina Stadium, home of college baseball’s mighty Gamecocks, is going to cost somebody nearly $5 million.

That’s a lot worse than a booted grounder by a shortstop.

The University of South Carolina’s Board of Trustees approved a $4.965 million expenditure Tuesday to pay for repairs needed along a concourse at the stadium. That work will begin as soon as this season’s last game is played there, either this weekend or the next. The job is expected to be done before next season starts.

As a wall near the ballpark’s left-field corner has settled, cracks have developed in both its brick facade and sidewalks next to it. That’s despite the 8,242-seat stadium on the banks of the Congaree River being only four years old — and costing $36 million.

The school, in a statement, said it is talking to engineering, architectural and construction firms involved in the stadium’s construction in an effort to recover those repair costs.

Sounds fair.

Yet at this point it’s unclear whether USC will get that money back.

Administrators at colleges with big-time sports programs, including those at USC and Clemson, should consider this another timely lesson. If institutions of higher learning must compete in a high-stakes athletic “facilities” race, the folks in charge must learn to get sufficient warranties on those modern sports palaces.

As for the Gamecocks’ chances of winning the College World Series for the third time in the last four years (they finished second last year), USC fans must hope that those stadium cracks aren’t a bad omen.

Though USC has earned a home-field edge in the NCAA regional at Carolina Stadium, it’s riding a three-game losing streak into Friday night’s opener against St. Louis.

At least Clemson fans can’t rub in that skid. The Tigers have lost five in a row entering Friday afternoon’s regional opener — also at Carolina Stadium — against Liberty.

But regardless of who wins on the college baseball field Friday and beyond, paying almost $5 million to repair a four-year-old stadium would be a losing deal.