Generally, if a company misses expectations for earnings, it will fall, and that's to be expected. But what is happening in the markets this year is exceptional, with large stocks cratering if they fail to meet analyst targets. It can be unsettling for shareholders, but that's the volatility investors need to brace for right now.

A couple of stocks that recently fell to all-time lows after reporting earnings are GoodRx (GDRX 1.62%) and Palantir Technologies (PLTR 0.03%). And if you're a contrarian investor, now could be the perfect opportunity to buy both of these beaten-up stocks.

Businessperson checking their phone.

Image source: Getty Images.

1. GoodRx

Shares of GoodRx got hammered, falling more than 25% on Tuesday after the company released its latest earnings numbers -- and that's despite encouraging results. The company, which helps consumers find cheap prescriptions, generated revenue of $203.3 million for the first three months of 2022, up 27% year over year. And its net income of $12.3 million was more than seven times the $1.7 million profit that GoodRx reported in the prior-year period.

The problem stems from the guidance, where GoodRx cautioned investors that it wouldn't hit its forecast for the year. This is due to a grocer, which GoodRx didn't name, making a change that would adversely impact the acceptance of GoodRx's discounts.

Since this happened late in the first quarter, it didn't have a big impact on Q1. However, GoodRx says it could bring down its revenue by $30 million next quarter. It projects revenue for the second quarter to be approximately $190 million -- less than what GoodRx reported this past quarter.

That's troubling news for GoodRx, but it comes with a caveat. The company notes that it isn't sure of the widescale impact of this grocer's policy change. And the guidance for Q2 sounds like a worst-case scenario as the company noted it simply didn't have enough data (because the development is so recent) to confidently forecast the rest of the year, so it didn't provide new guidance for 2022.

It did leave room to suggest it could do better than its guidance, which suggests to me that GoodRx is being conservative in its forecast.Unfortunately, that conservatism didn't help the company when it reported earnings, as it led to a sharp sell-off. GoodRx crashed to a new low of $7.33 this week, the lowest it has ever been. The beating this growth stock has taken could make it an incredibly attractive contrarian buy right now.

2. Palantir

Palantir is another company that crashed more than 20% this week after its results underwhelmed investors. The data analytics company reported that its sales jumped by 31% to $446 million for the period ended March 31. That beat analyst expectations of $443 million, but the company's adjusted earnings per share of $0.02 fell short by $0.02.

Another miss was in the guidance for the current period. Palantir's forecast of $470 million for Q2 comes in lower than the $483.7 million Wall Street was expecting.

In the fragile markets we're in right now, anything short of complete and outright bullishness is met with disastrous results. While investors may be disappointed with the guidance, the company reiterated that its annual revenue growth target of 30% until 2025 remains intact. Unlike GoodRx, that doesn't sound to me like the company is off track or suddenly in worse shape.

Investors may be focusing too much on analyst expectations and whether the company has hit its numbers. Last year, CEO Alex Karp slammed the short-term orientation of Wall Street, calling it "destructive" and saying his focus is on the long term. Those words are proving to be prophetic these days, with investors overreacting to the slightest bit of negativity surrounding a stock and dumping investments in otherwise solid businesses in one fell swoop.

While Palantir may not have hit its numbers, the tech company is still performing well; not only did revenue increase, but Palantir's operating loss also shrank by more than 65% from the prior-year period. Palantir's financials are improving, and that's a great sign the business is moving in the right direction. Investors willing to buy the stock today and stay the course over the long term could profit handsomely from doing so.