I'm a big Warren Buffett fan and have benefited from his investing wisdom. He's given me plenty of great things to write about through the years. I also own shares of Berkshire Hathaway (BRK.A -1.63%) (BRK.B -1.66%).

But Buffett isn't perfect. He's acknowledged on several occasions that he's made plenty of bad decisions.

In my view, he recently added another one to the list: Buffett sold some of Berkshire's shares of Amazon (AMZN -0.34%) in the first quarter. Here's why I think that was a mistake.

A couple of caveats

Let me first acknowledge a couple of caveats with my critique. First, Berkshire didn't sell much of its stake in Amazon -- only 115,000 shares. That's a little over 1% of the conglomerate's position in Amazon. Berkshire still owns over 10.5 million Amazon shares that are worth around $1.2 billion.

Still, I think Berkshire should have bought more Amazon stock instead of selling any shares at all. My view is that Amazon is a better long-term pick than any of the stocks that were added to Berkshire's portfolio, hands down.

The second -- and more important -- caveat is that Buffett might not have made the decision himself to sell shares of Amazon. After all, he didn't make the call to buy the stock in the first place. He told CNBC in 2019 that one of Berkshire's two investment managers (Todd Combs and Ted Weschler) decided to invest in Amazon.

However, Buffett acknowledged back then that he had been "an idiot" for not personally opting to invest in Amazon earlier. While the two lieutenants, Combs and Weschler, have autonomy in managing their portfolios, I doubt they would make any transaction that they knew Buffett was deadset against. My take is that he should have been deadset against selling Amazon.

Too much long-term potential to bail on

Why I am so adamant that Buffett made a mistake (or allowed one to be made) with Amazon? I believe the company has too much long-term potential to ignore or, even worse, bail on.

Over the near term, Amazon's earnings and free cash flow should increase significantly. The company is now laser-focused on growing cash flow. It has streamlined processes, shuttered underperforming businesses, and reduced headcount. Those efforts should pay off.

Sure, Amazon would probably be negatively impacted if the U.S. enters a recession. But Buffett has always argued that investors should have a long-term perspective. He also wrote to Berkshire Hathaway shareholders earlier this year that "near-term economic and market forecasts are worse than useless." The possibility of a recession (which even experts who expect one are predicting will be mild) shouldn't be a reason to sell shares of Amazon.

More importantly, a recession wouldn't diminish Amazon's long-term growth prospects. E-commerce still represents only 15% of total retail sales in the U.S. The market penetration for e-commerce is even lower in some countries. Amazon has a lot of room to grow on this front. And its logistics network gives it a huge competitive advantage, as demonstrated recently by Shopify's decision to sell most of its logistics business.

I'm even more enthusiastic, though, about Amazon Web Services (AWS). The shift of apps and data to the cloud should kick into overdrive with the increased adoption of artificial intelligence (AI). Amazon CEO Andy Jassy predicts that the current scenario of 90%-plus of global IT spending on-premises and less than 10% of spending in the cloud will flip over the next 10 to 15 years. I think he's right.

Buffett should listen to... Buffett

Should Buffett listen to my carping? No. But he should listen to himself.

In his 1988 letter to Berkshire shareholders, Buffett wrote: "[W]hen we own portions of outstanding businesses with outstanding managements, our favorite holding period is forever." Amazon is the leader in e-commerce and cloud services and is one of the top players in AI. It's demonstrated an ability to replicate its success in new markets. Buffett has praised Amazon founder and executive chairman Jeff Bezos in the past.

The bottom line is that Amazon is indisputably an outstanding business. Its management team has been and continues to be outstanding. And the stock's valuation remains attractive, relative to its projected future cash flow. Amazon is a stock to hold forever, rather than sell -- based on Buffett's own criteria.