WILMINGTON, Del. (Reuters) - Within weeks, two low-profile legal disputes may determine whether an unprecedented wave of bankruptcies expected to hit U.S. oil and gas producers this year will imperil the $500 billion pipeline sector as well.

A pump jack stands idle in Dewitt County, Texas January 13, 2016. REUTERS/Anna Driver

In the two court fights, U.S. energy producers are trying to use Chapter 11 bankruptcy protection to shed long-term contracts with the pipeline operators that gather and process shale gas before it is delivered to consumer markets.

The attempts to shed the contracts by Sabine Oil & Gas SOGCQ.PK and Quicksilver Resources KWKAQ.PK are viewed by executives and lawyers as a litmus test for deals worth billions of dollars annually for the so-called midstream sector.

Pipeline operators have argued the contracts are secure, but restructuring experts say that if the two producers manage to tear up or renegotiate their deals, others will follow. That could add a new element of risk for already hard-hit investors in midstream companies, which have plowed up to $30 billion a year into infrastructure to serve the U.S. fracking boom.

“It’s a hellacious problem,” said Hugh Ray, a bankruptcy lawyer with McKool Smith in Houston. “It will end with even more bankruptcies.”

A judge on New York's influential bankruptcy court said on Feb. 2 she was inclined to allow Houston-based Sabine to end its pipeline contract, which guaranteed it would ship a minimum volume of gas through a system built by a Cheniere Energy LNG.A subsidiary until 2024. Sabine's lawyers argued they could save $35 million by ending the Cheniere contract, and then save millions more by building an entirely new system.

Fort Worth, Texas-based Quicksilver's request to shed a contract with another midstream operator, Crestwood Equity Partners CEQP.N, is set for Feb. 26.

The concerns have grown more evident in recent days, raised in law firms’ client memos and investment bank research notes.

Last week, executives from Williams Companies Inc WMB.N and Enbridge Inc ENB.TO, two of the world's largest pipeline operators, sought to allay growing investor fears, saying they were reviewing contracts or securing additional credit guarantees to minimize the impact of the biggest oil bust in a generation.

MORE VULNERABLE THAN THOUGHT

So far, relatively few oil and gas producers have entered bankruptcy, and most were smaller firms. But with oil prices down 70 percent since mid-2014 and natural gas prices in a prolonged slump, up to a third of them are at risk of bankruptcy this year, consultancy Deloitte said in a Feb. 16 report.

Midstream operators have been considered relatively secure as investors and analysts focus on risks to the hundreds of billions of dollars in equity and debt of firms most directly exposed to commodity prices.

That's because firms such as Enterprise Products EPD.N, Kinder Morgan KM.N and Plains All American PAA.N relied upon multi-year contracts -- the kind targeted in the two bankruptcies -- that guarantee pipeline operators fixed fees to transport minimum volumes of oil or gas.

Now, with U.S. oil output shrinking and gas production stalling, many of the cash-strapped producers entering bankruptcy will be seeking to rid themselves of pricey agreements, particularly those with so-called minimum volume commitments that require paying for space even if it is not used.

“They will be probably among the first things thrown out,” said Michael Grande, director for U.S. midstream energy and infrastructure at Standard & Poor’s.

RUN WITH THE LAND

In bankruptcy court, Sabine’s lawyers argued for undoing a pipeline and gathering contract with Cheniere unit Nordheim Eagle Ford Gathering that is worth tens of millions of dollars in coming years.

Instead, a different midstream operator would be hired to build a new system that Sabine’s lawyer told the bankruptcy court would literally “wrap around” Nordheim’s existing infrastructure.

If Sabine gets the ruling it wants, it would immediately save the $35 million owed to Cheniere as a “deficiency fee” for failing to meet minimal volume commitments since the gathering system went into effect in September 2014.

Ryan Bennett, a Kirkland & Ellis attorney representing Sabine, told Bankruptcy Judge Shelley Chapman at a Feb. 2 hearing that Sabine had plenty of options once it shed the Cheniere contract.

“Maybe we do renegotiate with Nordheim. Maybe we buy their gathering system after this is all over,” he told Chapman.

Nordheim, like many midstream operators, has long considered its gas gathering and transportation agreements to be nearly bankruptcy-proof.

The Cheniere affiliate argued the contracts with Sabine went beyond a typical commercial agreement and transferred to Nordheim Sabine’s ownership right to collect and transport the gas collected within a certain area.

The midstream operator’s lawyer compared it to a property deed restriction that forever limited the height of building. Such restrictions are said to “run with the land,” and generally cannot be rejected in bankruptcy.

Sabine’s lawyers seemed to sway the judge when they countered that the contract language never transferred ownership rights, and if it did, it applied to mineral rights, not land rights.

Judge Chapman did not say when she would rule but told the hearing she was “inclining” toward ruling in Sabine’s favor. She encouraged the parties to reach a deal.

ALL IN THE FAMILY NO MORE

Lawyers told Reuters some gathering agreements did not appear well protected against bankruptcy, in part because the contracts were written when one company owned both energy production and midstream operations. In recent years, the industry has undergone significant reshuffling and many energy producers spun off gathering systems.

For example, the Quicksilver agreement was struck when the midstream operator was part of the Quicksilver corporate family.

In October 2010, Quicksilver sold its gas gathering and processing operations in Texas to a master limited partnership -- a once-popular type of tax-advantaged corporate structure -- affiliated with Crestwood Equity Partners for $700 million. The gathering operations included a pipeline agreement with Quicksilver that expired in 2020.

Earlier this month, Quicksilver asked U.S. Bankruptcy Judge Laurie Silverstein to end that deal in order to save the sale of its U.S. assets to BlueStone Natural Resources for $245 million. If Quicksilver fails to break the pipeline agreement, it would have to settle for a lesser bid that includes just $93 million in cash, according to court documents.

PAIN SPREADING

The infrastructure that midstream firms have built remains in high use so far, including the more than 12,000 miles of new pipelines commissioned since 2010. U.S. oil production is expected to fall only modestly, and most analysts expect prices to rebound somewhat in coming years.

Still, the pain is accruing already. Plains All American said this month that it expected a default from one unidentified customer who contracted for 10 percent of its BridgeTex pipeline, which transports crude from west Texas to the Houston area. Reuters later identified the customers as a little-known, privately held merchant called Stampede Energy. [IL2N15W14Z]

Analysts at Credit Suisse said Williams Partners WPZ.N could lose up to $400 million in earnings before interest, tax, depreciation and amortization, or EBITDA, if Chesapeake Energy Corp CHK.N, the second-largest U.S. natural gas producer, uses creditor protection to shed its minimum volume agreements.

While Chesapeake has denied any plans to file for bankruptcy, the head of the general partner of Williams took time on Thursday to explain to analysts and investors why he believed their deals were bankruptcy-proof.

“We believe gathering contracts such as ours are not the type of contract that would be rejected,” said Alan Armstrong, President and CEO of Williams Companies Inc. But he also said they were following the Sabine case closely.

(This story has been refiled to correct paragraph 15 show Michael Grande works for Standard & Poor’s, not Moody’s)