Investors have spent the past few months worrying about what difficult macroeconomic conditions and a slowing global economy might mean for corporate profits. Late Thursday, FedEx (FDX 0.12%) sounded the alarm that those concerns are justified.

FedEx expects to miss Wall Street's estimates by more than 30% in the recently completed quarter, and it warned the current quarter will be just as bad. The company saw market conditions deteriorate rapidly in the second half of August, and it's so uncertain about the months ahead that it pulled its full-year guidance.

The news is certainly unsettling, and it sent shares of FedEx down more than 20% and contributed to a broader stock sell-off on Friday.

But for investors focused on the long term, the FedEx warning is perhaps best viewed as a signal that there will be buying opportunities up ahead.

A global slowdown is taking its toll

CEO Raj Subramaniam said in a statement that FedEx was caught off guard by how quickly the world economy had worsened just before the end of its fiscal first quarter on Aug. 31. The company now expects Q1 earnings of $3.44 per share, well below analysts' expectations for $5.14 per share, and it said the second quarter's earnings could come in as low as $2.65 per share, compared to the consensus estimate of $5.48 per share.

"Global volumes declined as macroeconomic trends significantly worsened later in the quarter, both internationally and in the U.S.," Subramaniam said. "We are swiftly addressing these headwinds, but given the speed at which conditions shifted, first quarter results are below our expectations."

Wall Street has been on edge the past few months looking for signs of exactly what Subramaniam is describing. War in Europe and a combination of tightening credit conditions and coronavirus lockdowns in China have slowed growth overseas, and at home the Federal Reserve's campaign to fight inflation with higher interest rates is designed to cool down the U.S. economy.

FedEx could be the canary in the coal mine signaling a miserable earnings season as October rolls around and most other S&P 500 companies begin to report quarterly updates. What's likely spooking investors is Subramaniam's observation that conditions grew significantly worse in late August. If other multinational businesses experienced the same thing in August and September, earnings expectations are likely too high for a broad range of companies.

Could some of this be specific to FedEx?

Economic conditions are almost surely taking their toll, but investors should be aware that FedEx may be feeling the impact more acutely than most. FedEx is under new management -- Subramaniam only took over as CEO in June following the retirement of company founder Fred Smith -- and the company is in the early stages of a comprehensive reorganization and cost-cutting plan.

FedEx in recent years has battled through operational missteps in its ground delivery business, labor issues with contractors, and a difficult integration of European delivery company TNT Express. It is also still adjusting its domestic business after a high-profile split with Amazon.com, which was once a major customer.

Given what is going on at FedEx, it is possible this is more a slowdown hitting at an inopportune time, creating an outsize impact.

It's worth noting that on Sept. 6, FedEx archrival United Parcel Service (UPS 0.14%) reaffirmed its 2022 financial targets.

Here's how you can get ready

Even if FedEx is getting hit harder than most, it seems likely we'll be hearing a lot more about some of the issues the company described. Analysts have been watching for a wave of corporate profit warnings, and if FedEx is any indication, that wave is closing in.

Fortunately, investors have had a lot of time to prepare for this reality. The S&P 500 is down nearly 20% year to date, meaning at least some of the potential downside is likely priced in already.

With earnings season set to ramp up in less than a month, now is the time for investors to make or update their watch lists. Nobody does their finest analysis in times of panic -- for example, when a stock is down 20% post-earnings. And the best companies are strong enough to weather short-term challenges.

Despite its current rough patch, FedEx is a market-beating investment over time that is set up well to take advantage of long-term trends like inshoring and the continued growth of e-commerce. Should FedEx be a harbinger of things to come, there are likely to be opportunities to buy into other long-term market-beaters at prices well below where they are today.

And it's worth noting that FedEx remains confident in hitting its fiscal 2025 goals for profitability and cost cuts. It won't happen overnight. But for those who have the patience to wait out the current business cycle, uncertain times are the best times to buy.