A high-powered investment fund that asked a federal court to cast a ray of sunshine on a case that has been clouded by secrecy may now be suffering from a bad sunburn.

Newly unsealed documents show that when the government in 2012 changed the terms of the bailouts provided to Fannie Mae and Freddie Mac it had good reason to fear that over time the housing finance giants would dangerously deplete their backstops from the U.S. Treasury. To avoid this, Treasury officials came up with a scheme to change Fannie and Freddie’s dividend from a fixed 10 percent to an adjustable dividend that would rise and fall with their profits, guaranteeing that the companies could always meet their obligations to the federal government.

The documents also show that Treasury officials engaged in serious negotiations with Edward DeMarco, then head of the Federal Housing Finance Agency,  the government body that oversees Fannie and Freddie. At one point, Treasury officials worried that DeMarco might balk at their plan out of a fear that it was a scheme to abandon plans to wind the companies down and reduce the federal government’s role in the mortgage market.

Those are serious setbacks for Fairholme Funds, a mutual fund company that owns shares in Fannie and Freddie.  Lawyers for Fairhome had asked the court to force the government to release the documents to bolster their lawsuit claiming that the change to the bailout deprived Fannie and Freddie shareholders of their rights to the companies’ profits. While many similar cases brought by investors have already been dismissed by federal courts, the judge in the Fairholme case ruled that plaintiffs might be able to continue their lawsuit if they can show that the Federal Housing Finance Agency lacked independence from the U.S. Treasury when it agreed to the new bailout terms.

Instead of supporting Fairholme’s case, however, the documents undermine it.

A June 2012 email between Treasury Department officials Mary John Miller and Michael Stegman shows that far from controlling the FHFA, Treasury officials were worried that FHFA might not go along with their plans to amend the Preferred Stock Purchase Agreements, the legal documents that control the terms of Fannie and Freddie’s bailout. The email summarizes a meeting between Stegman, Treasury Secretary Tim Geithner and DeMarco. At that meeting, the officials discussed the possibility of including in the changes to the PSPAs a requirement that Fannie and Freddie go along with Treasury’s plan to reduce the principal on troubled mortgages backed by the companies to provide relief to home-owners, a scheme that DeMarco would object to and eventually ban outright on the grounds that it would cost the companies too much and put taxpayers at greater risk.

“Through weeks of negotiating terms of possible amendments to the PSPAs, he never questioned the need to adjust the dividend schedule this year. Since the Secretary raised the possibility of a PR covenant, DeMarco no longer sees the urgency of amending the PSPAs this year,” Miller said.

In other words, DeMarco was threatening to back away from the entire deal to change the bailout if Treasury tried to include a mandate for mortgage principal reductions. That’s strong evidence that the FHFA’s independence was alive and well when it struck the deal to change the bailout.

Other documents support the government’s contention that it put the profit sweep in place in order to protect taxpayers from further losses and prevent them from running through their backstop. Fairholme and other shareholders have long sought to prove that this argument was just a pretext for the government to seize the profits of Fannie and Freddie.

Prior to the 2012 changes, Fannie and Freddie had taken $187 billion of taxpayer funds to stay afloat. Because their earnings were often inadequate to allow them to pay the 10% dividend on those bailout funds, Fannie and Freddie were forced to draw additional funds from Treasury only to pay it right back to Treasury. This circular draw created an illusion that Fannie and Freddie were making timely payments on their bailout funds when in reality they were just digging themselves deeper into a hole. Since each draw increased the size of the dividend owed, they made it less and less likely either company would be able to meet their obligations.

In December 2011, Mary Miller drafted an information memorandum on the need to structure the bailout. Her analysis began by pointing out that the funds available to support Fannie and Freddie would be capped at $275 billion by the end of 2012. But based on Treasury’s financial projections, Fannie and Freddie would need to use an additional $100 billion over the next ten years, leaving just $175 billion of remaining support. Treasury officials worried that financial markets could become destabilized if these further draw downs created doubts on the ability of Fannie and Freddie to support their trillions of dollars of financial guarantees.

“As shown in the combined gross draw line above, the GSEs continue to draw upon the PSPAs throughout the forecast period to pay required dividends to Treasury. Consequently, once the caps are fixed in 2012, the collective PSPA capacity is forecasted to decrease by over $100 billion within the next ten years,” Miller wrote.

When Treasury announced the new dividend policy, it said that this would further the goal of eventually winding the companies down and reduce risk to taxpayers by accelerating repayment of taxpayer funds. The new documents show that this was what Treasury officials were saying behind the scenes as well.

“We are making sure that each of these entities pay the taxpayer back every dollar of profit they make, not just a 10% dividend,” Obama administration aide Jim Parrott wrote in an August 2012 email. “The taxpayer will thus ultimately collect more money with the changes.”

“With the overall set of changes we have removed any doubt about the long term fate of these entities: they will NOT be allowed to return to profitable entities at the center of our housing finance system, but instead wound down and replaced with a system driven by private capital and lower risk to the taxpayer,” Parrott wrote.

The documents do raise one important question about the government’s tactics in the lawsuit. Throughout the case, the government has resisted releasing thousands of documents, claiming they were protected from disclosure by array of privileges. At times, Judge Margaret M. Sweeney has appeared frustrated at the government’s insistence on secrecy. And some investors and other observers have wondered why the government would resist disclosure unless their was something to hide.

Yet in thousands of documents that have been unsealed by the court in the case, not one reveals any misdeeds and a great many appear to support the government’s arguments. So why did the Obama administration–and now the Trump administration–insist on fighting for confidentiality?

Whatever the answer, the Fannie and Freddie investors whose lawyers fought so hard to shine light on these documents released must be feeling a bit burned.