EAST PATCHOGUE, N.Y. - A year ago, Long Island Judge Jeffrey Spinner concluded that a mortgage company's paperwork in a foreclosure case was so flawed and its behavior in negotiations with the borrower so "repugnant" that he erased the family's $292,500 debt and gave the house back for free.

The judgment in favor of the homeowner, Diane Yano-Horoski, which is being appealed, has alarmed the nation's biggest lenders, who say it could establish a dramatic new legal precedent and roil the nation's foreclosure system.

It is not the only case that has big banks worried. Spinner and some of colleagues in the New York City area estimate they are dismissing 20 to 50 percent of foreclosure cases on the basis of sloppy or fraudulent paperwork filed by lenders.

Their decisions illustrate the central role lower court judges will have in resolving the country's foreclosure debacle. The mess came to light after lawsuits and media reports showed lenders were routinely filing shoddy or fraudulent papers to seize the homes of borrowers who had missed payments.

In millions of cases across the United States, local judges have wide latitude to impose sanctions on banks, free homeowners from their mortgage debts or allow the companies to proceed with flawed foreclosures. Ultimately, the industry is likely to face a messy scenario - different resolutions by courts in all 50 states.

The foreclosure dismissals in this area of New York have not delivered free homes for borrowers. With so much at stake, lenders in this part of New York are aggressively appealing foreclosure dismissals, which is likely to keep the legal system bogged down, foreclosed homes off the market, and homeowners like the Yano-Horoski family in legal limbo for years.

"We believe the Yano-Horoski ruling, if allowed to stand, has sweeping and dangerous implications for the entire mortgage lending industry," said OneWest Bank, the family's mortgage servicer.

The situation in Suffolk and Nassau counties on Long Island and Kings County in Brooklyn- which have among the highest rates of foreclosure in the state and where the 81 judges handling foreclosures have become infamous over the past few years for scrutinizing paperwork for errors - provides a window into how the crisis could unfold across in the country.

While the level of tolerance for document mistakes varies from judge to judge, the group as a whole has a reputation for ruling against mortgage companies when paperwork issues or other problems arise. At least one bank, J.P. Morgan Chase, requires document processors to separate foreclosures cases from these three counties from those in the rest of the country. A high-ranking executive of the company is specially assigned to sign off on the area's foreclosure filings.

Judge Dana Winslow of Nassau County says he's thought a lot about why judges in his area are more apt to question filings. He said it comes down to one thing: Lack of trust for Wall Street. In this region, judges have seen a lot of inaccurate filings from the financial sector.

Trust "of the lending institutions and Wall Street has eroded in some areas of the country more than others," Winslow said.

Craig D. Robins, a foreclosure defense attorney who authors the Long Island Bankruptcy blog, said of the Yano-Horoski case: "I think we're going to see more decisions like this across the country. Many judges are finding their court calendars clogged with cases that have all these flaws in them that never should have been brought in the first place or should never have been brought without more due diligence."