Even Oracles can have second thoughts. On Friday, billionaire investor Warren Buffett—known as the Oracle of Omaha for his investing prowess—plunked down $9 billion in cash for the bankrupt remnants of Energy Future Holdings, the Dallas-based utility once known as TXU. The jewel in the deal is Oncor, the transmission company that distributes power to 10 million homes and businesses across North Texas.

In recent years, Buffett’s Berkshire Hathaway has had its eye on utilities worldwide, which it plans to keep buying “for decades to come,” as he told shareholders in 2014. Energy Future, however, isn’t just any utility, and Buffett must be hoping his latest investment turns out better than his previous run-in with the company.

Energy Future was formed in 2007 through the $32 billion takeover of TXU by a team of Wall Street and private equity firms that included Goldman Sachs, KKR, and TPG, run by Fort Worth investor David Bonderman. The deal was the biggest leveraged buyout in history and it all pretty much hinged on one thing: a bet that natural gas prices would rise.

But a year later, hydraulic fracturing unleashed an abundance of natural gas, and prices plunged, taking Energy Future’s profits with them. The company was unable to pay the debt it had amassed to fund the buyout. One of the biggest holders of that debt? Warren Buffett.

Berkshire Hathaway bought $2.1 billion worth of Energy Future’s bonds, and it sold them six years later for an $873 million loss. Buffett acknowledged that he “totally miscalculated the gain/loss probabilities” in buying the bonds.

“Most of you have never heard of Energy Future Holdings. Consider yourselves lucky; I certainly wish I hadn’t,” Buffett wrote in his 2013 letter to Berkshire Hathaway shareholders.

This time, though, things are different. Buffett’s not buying a slice of debt, he’s buying the whole company. Energy Future sold off its generating assets in bankruptcy, and it was the generating business that led to the company’s losses. Oncor, whose services are still regulated in Texas, is a money machine because its rates are set to guarantee a return for the company. Buffett’s offer values Oncor’s equity at more than $11 billion, significantly more than the $9 million he’s putting up.

Oncor’s luster has attracted other suitors, including Sharyland Utilities, controlled by the family of Dallas billionaire Ray Hunt, and NextEra Energy of Florida. State regulators rebuffed both of those offers.

While Buffett’s reputation might sway the Public Utility Commission, his success is far from assured. The activist hedge fund Elliott Management has been buying up Energy Future’s debt in bankruptcy, and its holdings are reported to total about $2.9 billion. The fund has been trying to convince creditors to convert its debt into equity, essentially giving it control of the company. In May, Elliott sued Energy Future, arguing that the four-year reorganization effort has failed.

If Buffett can find a way to win over Elliott and make peace with the PUC, he may not be so sorry he’d heard of Energy Future Holdings this time.