A Boston contractor and its surety are battling it out in federal court over who should pick up the tab for millions spent fixing a modular apartment project gone wrong.

Philadelphia-based Arch Insurance is suing The Graphic Builders in U.S. District Court in Boston, arguing it should be freed from its obligations under an $8.6-million performance bond on a modular apartment project that had extensive defects that needed to be fixed.

The case, in turn, highlights the at-times thorny issues surrounding performance bonds when a project goes bad, as well as the potential quality control risks involved with modular construction.

The case, in turn, highlights the at-times thorny issues surrounding performance bonds when a project goes bad, as well as the potential quality control risks involved with modular construction when prefabricated sections are churned out at a factory hundreds of miles from the construction site.

The conflict involves a 171-unit apartment project in Boston’s Charlestown neighborhood.

Arch "is entitled to a judgment declaring it is exonerated and discharged from any and all liability arising from the performance bond,” lawyers for the surety contend in a federal court filing.

In its complaint, Arch claims that the Graphic Builders, or TGB, a wholly-owned subsidiary of Tocci Building Corp., violated several performance bond conditions.

In particular, TGB went ahead and spent $3.1 million repairing and remediating multiple issues with the modular units, and then sought payment from Arch under the bond.

Instead, TGB should have allowed Arch, as laid out under the terms of the bond, to assess the situation and potentially bring in another contractor to do the work in place of modular firm, the surety claims.

Arch also contends TGB never completely cut ties with the modular subcontractor, as required under the performance bond.

Firing back, TGB contends Arch inappropriately used provisions under the bond related to performance issues – such as a contractor failing or unable to finish a project – to reject its claim based on an entirely different set of circumstances.

TGB contends it filed an indemnity claim to collect for damages incurred, with the bond’s provisions related to performance issues having no bearing.

It also brandished correspondence showing it had issued a notice of default to the Quebec-based modular subcontractor, RCM.

For its part, TGB has filed suit against RCM, arguing something went terribly wrong with the modular apartment project requiring extensive work and repairs.

Boston-based Berkeley Investments, a major development firm in the city, bought the Graphic Arts building then hired Tocci in 2017 to convert the historic structure into 46 loft-style apartments. In addition, the project also called for building an attached four-story building with another 125 units featuring prefabricated, modular sections.

The rectangular modular boxes ranged in length from 60 to 65 ft and weighed 30,000 to 35,000 lb each.

Yet due to a series of alleged manufacturing and installation errors on part of the modular subcontractor, RCM, the apartment project wasn’t able to open its doors until September, 2019, a delay of roughly nine months, TGB contends.

For its part, TGB, entered into arbitration with RCM last September, filing a lawsuit a few weeks later in Suffolk County Superior Court, laying out its allegations of subpar work.

The first hint of the issues ahead came in April, 2018, when RCM churned out the prefabricated, modular units “without approved shop drawings,” according to a filing by TGB with the American Arbitration Association.

RCM was then 10 weeks late in delivering the modules. When the subcontractor began assembling the modular units, TGB and the project owner quickly noticed they were “defective.”

The modular units were missing code-compliant and functioning mechanical, electrical, plumbing and fire suppression systems, TGB states in its court filing.

The problems also extended to the building’s exterior, with a “substantial variation in size” among the modular sections RCM delivered, and with additional issues related to mistakes by the subcontractor in the installation process as well. Meanwhile, the entire project was plagued with 265 leaky windows, according to court documents.

While RCM met with TGB executives in September, 2018 to work out a solution to the issues, the subcontractor “failed to complete the remediation plan and was unable to produce a warranty from the window manufacturer,” the contractor claims in its filing.

“TGB is seeking indemnification from the Surety for these damages arising out of RCM’s breach of contract,” lawyers for TGB write.

Pushing back, RCM has filed a motion in federal district court to dismiss TGB’s complaint, arguing the two sides have already entered into arbitration, as required under their contract.

However, while acknowledging the arbitration talks, TGB has countered that it still wants to maintain its case in federal court in order to confirm any award it might win after the arbitrator issue its decision.

Lawyers for Arch, TGB and RCM all declined to speak on the record.