Palantir (PLTR -3.72%) was among my favorite holdings when I bought shares during the bear market of 2022. Its ability to deliver insights by applying artificial intelligence (AI) and machine learning to draw conclusions made the company stand out among SaaS stocks.

That became even more true upon the release of its Artificial Intelligence Platform (AIP). That product delivers productivity gains that were game-changing for its clients.

Despite such benefits, I decided to part with my entire Palantir position right before the Nov. 4 earnings announcement. Admittedly, that decision may baffle many growth investors since the stock surged following the earnings release for the third quarter of 2024. Nonetheless, the real question is whether I stick with this decision over time. Here's why.

Why I sold

The decision to sell did not come easy. My most painful investing lesson involved my sale of Booking Holdings (BKNG -1.15%) during the dot-com bust after I had made a quick profit. While the sale looked like the right decision for several years, it has since risen almost 100-fold from where I sold it. By not holding (or at least repurchasing the shares), I missed out on what could have been a life-changing gain.

Consequently, I now have to ask myself whether I made the same mistake with Palantir. I purchased the stock at an average of $9 per share, giving me a gain of approximately 370% as I sold at $42 per share.

The most crucial factor in my decision to sell was valuation. When I sold, the forward P/E ratio was at 115, and the price-to-sales (P/S) ratio was 40, and both signify a very expensive stock by nearly any measure. Despite both ratios rising from that point, the valuation led me to question whether Palantir shares still offered significant upside over the near term.

With enough growth, I could have forgiven the high multiples, especially with the results reported in the AIP boot camps. Palantir claimed in the second quarter of 2024 that one convenience store chain went from prototype to paid pilot in 25 days, converting its inventory management and price optimization case after the pilot.

Another attendee reported achieving more in one day with AIP than a hyperscaler had in four months. Such eye-popping productivity gains should accrue to Palantir's top line. Still, I felt the portion of that growth accruing to Palantir was not enough to justify its stock price.

In the first three quarters of 2024, revenue increased by 26% to just over $2 billion. Also, the slow growth in operating expenses allowed net income in the first nine months of 2024 to spike to $383 million, up from $116 million in the same period in 2023.

Admittedly, the release of that data led to a spike in the stock price, which may appear to bolster the argument that I made the wrong decision.

However, despite the potential of AIP, Palantir is on track for a growth slowdown. In 2025, analysts predict its revenue will grow by only 21%, less than the 26% Palantir has forecast for 2024. Such increases are bullish for Palantir stock, but they were not enough for me to justify the company's valuation.

Will I repurchase Palantir someday?

Remembering my Booking Holdings lesson, I will keep Palantir on my watch list, and to be honest, I still hold a bullish view of the stock over the long term. Also, one cannot time the market, forcing me to acknowledge the sale could turn into a mistake.

Nonetheless, even the most successful stocks over the last 50 years, including Nvidia and Amazon, experienced retracements of more than 50% at points in their histories, a risk that could validate my decision to book my gains.

Investors should also remember that Palantir has already experienced a decline of just over 85% in its short history. While I do not think it will fall back to its price in late 2022, its valuation increases the possibility of a massive pullback in Palantir stock.

Ultimately, the Booking Holdings mistake is still on my mind, so if Palantir's earnings and sales multiples become more reasonable, it is highly possible that I will repurchase my shares. But with more potential downside than upside in the near term, I'm happy to stay on the sidelines for now.