Has any S&P 500 stock had a better year this year than Palantir Technologies (PLTR -3.72%)? The stock is up a staggering 378% since the beginning of 2024 (as of Dec. 26), producing outsize investment returns for virtually any portfolio it touches.

I don't want to be a pessimist, but it could be time to share a cautionary tale about stocks that behave like this. Palantir has legitimate growth tailwinds in artificial intelligence (AI), specifically its AIP platform for deploying AI applications in the government and private sectors. However, its fundamentals haven't kept up with the stock price.

History doesn't always repeat itself, but you can learn from it. Microsoft (MSFT -1.73%) one of today's largest and most influential companies, experienced a similar situation over 20 years ago.

Below, I'll explain what happened to the stock back then and why Palantir's similarities to Microsoft make it arguably the largest potential bust of 2025.

Going back in time to the turn of the millennium

You may have heard AI being called the most important technology since the internet's arrival in the late 1990s. That could be true. Yet the stock market tends to get ahead of itself. Excitement for the internet in the late 1990s fueled a stock market bubble that ultimately popped in early 2000. Microsoft became one of Wall Street's hottest stocks in the mid-1990s due to its successful Windows computer operating system software.

The stock enjoyed a massive run that inflated its valuation to astronomical levels. At its peak, Microsoft stock traded at a price-to-sales (P/S) ratio over 31:

MSFT PS Ratio Chart

MSFT PS Ratio data by YCharts

It can be hard to appreciate valuations when they're just numbers on a chart. To be clear, paying 31 times a company's total revenue for its stock is expensive. Mathematically, an investor buying stock at that valuation waits 31 years for the company (not including revenue growth) to repay their investment with sales dollars. That's not profits, by the way -- it's sales!

That's a terrible return on your investment; you're waiting many years to make your money back, even if the business is rapidly growing. Unfortunately, investors don't think about it in these terms when emotions like greed and euphoria run rampant.

As you know, Microsoft grew back in the 1990s and became arguably the world's largest and most prominent technology company. But how did buying at the stock's peak valuation turn out?

MSFT Chart

MSFT data by YCharts

The stock collapsed due to its unrealistic valuation and took approximately 18 years to reach new highs. Again, Microsoft's business kept growing; its revenue increased by over 330% during those 18 years.

Could Palantir be a worse bubble than Microsoft?

It's hard not to see some similarities between Microsoft back then and Palantir today. Palantir's Artificial Intelligence Platform (AIP) has become arguably the leading software platform for deploying AI applications. However, similar to Microsoft years ago, the market's excitement has pushed the stock to unrealistic heights.

Astonishingly, Palantir's P/S ratio has gone parabolic, rising to more than double Microsoft's peak in the late 1990s:

PLTR PS Ratio Chart

PLTR PS Ratio data by YCharts

Palantir will generate approximately $2.8 billion in revenue this year, and its market cap has reached $187 billion. This is worse (almost twice as expensive) than when zero-percent interest rates fueled a stock market bubble just a few years ago.

Ultimately, nobody can time the market. Stock prices can do funny things for longer than you'd think.

But the music will stop. It always does when valuations go parabolic.

When the time comes, it's probably going to hurt. Investors buying into the parabolic upward momentum over these past couple of months could experience a long stretch of poor returns as the stock's valuation unwinds -- even as the business grows, much like Microsoft investors did.

Given Palantir's nearly 400% returns in 2024, these circumstances make it a prime candidate to be the ultimate bust of 2025.