A Markets Insider analysis shows that Warren Buffet's company made a $2 billion mistake by selling its stock in the oil company.

The renowned investor's conglomerate has spent about $10 billion to purchase 188 million Occidental shares this year, giving it a 20.2% stake in the oil and gas explorer and producer.

Instead of dumping it in 2020 and rebuilding it at triple the price in the last few months, it could have saved a lot of money.

Based on the energy company's average closing stock price in the second half of the year, Warren Buffet's company paid an estimated $810 million to buy 18.9 million shares of the company.

In 2020, the company received another 28.8 million shares after Occidental paid $400 million of preferred stock dividends instead of cash. The dividends were part of a $10 billion financing deal that was struck with Warren Buffet's company.

During the second and third quarters of 2020, the entire position of nearly 48 million Occidental shares was sold by Warren Buffet's company. The conglomerate's value would have doubled to $3.1 billion if they had kept those shares.

As Russia's invasion of Ukraine continues to disrupt global energy supplies and cause fuel prices to go up, the stock price of Occidental has doubled this year.

This year's stock purchases by the company means it has effectively rebought the shares it sold for.

It paid a weighted average price of $53 per share to build its stake this year, or more than triple the average closing price of 15 during the two quarters when the company was owned by Warren Buffet.

The company's prospects were rejuvenated when oil prices surged within two years of the company's exit. They lost out on nearly $2 billion in profits when they sold their stake in Occidental in 2020 and spent an extra $1.7 billion to rebuild it this year.

There are 26 stocks with solid financials that are set to perform better than the Fed's rate hikes.