Some of the most public contracting problems in recent years have involved major contractors working on state and local programs — a trend that some analysts say is no coincidence.

Most recently, McLean-based Science Applications International Corp. is grappling with CityTime, a time-keeping program it ran for New York City but which has been labeled “a massive and elaborate scheme to defraud the city” by the U.S. Attorney’s Office for the Southern District of New York.

Two former SAIC employees have been charged with conspiring to defraud the city, and the company has taken a $232 million charge in anticipated losses. SAIC is “fully cooperating with the investigation,” an SAIC spokeswoman said in a statement.

“It just makes it a lot more difficult when you’re working with every state versus just one customer — the federal government — where you have a good handle on the regulations,” said Michael S. Lewis, director of equity research at Lazard Capital Markets.

Lewis himself used to analyze companies focused on state and local contracting but gave it up because of the complexity of understanding each municipality and state’s individual requirements.

There are other examples beyond SAIC. Falls Church-based Northrop Grumman received plenty of its own bad press in 2010 when Virginia’s information technology infrastructure — managed through a $2.3 billion, 13-year partnership with Northrop — went down for almost a week, hitting state services from driver’s licenses to tax refunds.

In a statement, Northrop said Virginia’s shift to a managed IT environment was a significant one with “inherent challenges” and noted that the program has made significant progress.

And Falls Church-based Computer Sciences Corp. and the county of San Diego tangled over a major outsourcing contract originally signed in 1999. In 2002, CSC announced that the two had settled their dispute and made an amendment to the original contract increasing CSC’s accountability. The company said in a statement last week that it successfully completed the contract and “continues to have good relations” with San Diego

William Loomis, managing director at Stifel Nicolaus, which has a business relationship with many contractors, said state and local contracts almost always set a fixed price — leading to high risks if the contractor underestimates the intensity of the work or if the customer tries to increase the workload.

And in general, Lewis said, the profits are typically “razor thin.”

Companies are bidding very low, Lewis said, meaning “there’s not much room for execution error.”

Loomis said the recent public struggles may temporarily scare away some contractors.

“It’s fresh on the mind of a lot of bigger companies,” he said. But “I think you’ll see bigger companies look to state and local again in the future.”