On Wednesday, General Motors (GM -3.53%) reported third-quarter earnings per share (EPS) well ahead of analysts' estimates, overcoming severe supply constraints. The company also raised its full-year EPS forecast and said that it expects to report a full-year adjusted operating profit near the high end of its guidance range.

Yet investors weren't impressed. GM stock fell more than 5% on Wednesday and has retreated 15% from the all-time high it reached earlier this year. The recent pullback represents a great buying opportunity for long-term investors.

GM Chart

GM stock performance, data by YCharts.

Revenue plunges but profitability holds up

General Motors did a very good job of managing through the global semiconductor shortage in the first half of 2021. However, the shortage finally caught up to it last quarter. In the key North American market, vehicle wholesales plunged 47% year over year to approximately 423,000 units, purely because of supply constraints. GM also suffered smaller production losses in other regions.

The production disruption caused revenue to plunge 25% year over year to $26.8 billion. In North America, revenue fell by 29%, with sharply higher average selling prices partially offsetting the huge drop in volume.

Despite the massive revenue decline, GM recorded a $2.9 billion adjusted operating profit last quarter. That fell well short of the automaker's $5.3 billion adjusted operating profit in the prior-year period but was roughly in line with its earnings in Q3 2019 and Q3 2018. A net benefit of $700 million from a recent settlement with battery supplier LG to cover recall costs contributed to the solid operating profit, as did a $1.1 billion pre-tax profit from GM's finance subsidiary.

A light blue Chevy Bolt driving on a road.

Image source: General Motors.

Adjusted EPS totaled $1.52: down from a record $2.83 a year earlier but miles ahead of the analyst consensus of $0.96. While some analysts may not have factored in the recall settlement, that alone couldn't fully explain the earnings beat. In short, GM continues to perform well in the face of external challenges.

Wall Street doesn't like GM's guidance

Looking ahead, GM now expects its 2021 adjusted operating profit to wind up near the high end of its $11.5 billion to $13.5 billion guidance range. Thanks to a lower expected tax rate, the company also raised its adjusted EPS forecast by $0.30, to a new range of $5.70 to $6.70.

Many Wall Street analysts found the earnings guidance underwhelming, noting that it implied a significant step down in operating income relative to the past few quarters. Furthermore, the General said it expects full-year adjusted automotive free cash flow to come in at the bottom of its previous guidance range of $1 billion to $2 billion. That irked other analysts and may explain why GM stock dropped after the earnings report.

However, investors may be underestimating the extent -- and short-term nature -- of the chip shortage's impact on GM's results. General Motors expects output to recover this quarter to around what it produced in Q2. But the 664,000 wholesales it recorded in North America during that period still represented a roughly 25% reduction compared to its performance a few years ago.

Low volume tends to reduce profitability, due to poor factory utilization and lower labor productivity. It has an even greater impact on cash flow, due to unfavorable changes in working capital. As the chip shortage eases over the next year or two, GM's production will rebound, driving earnings and cash flow higher.

A dark Chevy Silverado driving on a rural road.

Image source: General Motors.

Huge pent-up demand and long-term growth potential

General Motors' production should increase significantly next year, relative to 2021. However, the ongoing chip shortage means that it could take a year or more for output to return to peak levels. Even as production rebounds, GM should retain strong pricing power, due to pent-up demand related to the current vehicle shortage. The automaker will also have to rebuild its U.S. dealers' inventories, which have plummeted to around 129,000 vehicles at the end of September: down from 492,000 a year earlier.

The combination of rising production and strong pricing should offset headwinds from the company's decision to ramp up its growth investments, driving EPS higher. Free cash flow will rebound even more dramatically, thanks to favorable working capital movements. Strong demand could boost GM's revenue, earnings, and cash flow for several years.

Looking further ahead, GM expects to more than double its revenue by 2030 while expanding its profit margin. New business lines like robotaxis, auto insurance, connected services, and electric delivery vans will drive much of this growth.

Despite this favorable outlook, GM stock trades for just eight times earnings. That makes it one of the best bargains in the stock market today.