The knee-jerk reaction makes sense on the surface. Dollar General (DG -0.86%) missed its third-quarter earnings estimates, and investors panicked. Fanning the bearish flames is the company's not-so-hot guidance for the quarter now underway.

As has been the case so many times for other stocks this year, though, last Tuesday's 8% stumble suffered by Dollar General shares is a great buying opportunity. The retailer's Q3 numbers notwithstanding, the long-term story here remains a compelling one.

Dollar General, by the numbers

All told, Dollar General turned nearly $9.5 billion worth of sales into earnings of $2.33 per share during the three-month stretch ending in October. That top line was up 11.1% year over year, driving a 12% increase in profits. Revenue rolled in better than the $9.42 billion consensus, although its income fell short of the $2.54 per share analysts were anticipating.

The real shocker, however, was the dialed-back guidance the company served up for the remainder of the year. Dollar General is now looking for Q4 per-share earnings of between $3.15 and $3.30 versus Wall Street's average expectation of around $3.66.

The retailer cited inventory logistics and supply chain challenges as the key culprit for the lackluster outlook. Inventory levels grew 34% year over year to a little over $7.1 billion, far outpacing sales growth, and now the company is struggling to find places to put it all. This bloat increases temporary storage costs and transportation costs, but also increases the likelihood of merchandise theft, damage, and missed sales opportunities.

Dollar General suggests these challenges are temporary, and they probably are. The market's not quite buying it, though, in light of the stock's sizable pullback on Thursday. That sell-off is your entry opportunity.

Nothing's actually changed with the thesis

As was noted, the stock's stumble makes enough superficial sense. As is so often the case, however, the market is losing sight of a much bigger picture.

If you're unfamiliar, Dollar General operates more than 18,000 variety stores in 47 different states. It seemingly competes with monster-sized players like Walmart and Target, but a closer look reveals that it's usually not competing with either discounter giant... at least, not head to head. Roughly three-fourths of its stores are located in communities with populations of less than 20,000, often making it one of the only readily accessible general merchandise retailers in the area.

The company also offers convenience Walmart and Target can't. Most of its shoppers finish their shopping trips in less than 10 minutes, thanks to its relatively small 9,000 square-foot stores. More affluent consumers who haven't historically been its core customers are now embracing this once-unlikely shopping option too, now that inflation is running rampant. It's the same inflation that is pumping up the company's inventory costs.

DG Inventories (Quarterly) Chart

DG Inventories (Quarterly) data by YCharts

Largely lost in all the noise of the retailer's third-quarter report and fourth-quarter outlook is that the underlying investment thesis has not changed. Dollar General still serves mostly under-served communities, and the company is still making itself more marketable to those markets. Its DG Fresh initiative placing basic groceries in all of its stores as of last year is still in effect, for instance, and fresh produce can now be found in roughly 3,000 locales. Another 2,000 stores should be selling produce by the end of 2023.

Another initiative called DG Wellbeing is widening the selection healthcare goods at more than 3,000 stores now as well, en route to more than 4,000 before the end of the year. The company is even tinkering with mobile health clinics.

End result? With or without the current headwinds, Dollar General has found a winning growth formula. Its inventory headaches will eventually work themselves out, one way or another. Nothing else has changed.

Dollar General's bottom line will start to grow again once its inventory problems are mitigated.

Data source: Thomson Reuters. Chart by author.

The kicker: The retailer may actually thrive in a weak economy when consumers are even more cost-conscious. 

Just keep the bigger picture in mind

Like Target and Walmart, Dollar General is now sitting on more inventory than it would like at this point in time -- the result of aggressive ordering when it wasn't clear exactly how much stuff it would need once the world began shrugging off pandemic-prompted worries. Look for profit margins to be crimped going forward as the company works through its current inventory glut.

The company is better-equipped to handle the task than the stock's action this week suggests. It has its own fleet of trucks to ferry merchandise exactly when and where it's needed, and its smaller distribution network should make it easier to manage than similar supply chains utilized by Walmart or Target.

Moreover, during the Q3 conference call, relatively new CEO Jeff Owen even noted how the recent addition of 2 million square feet worth of storage and merchandise handling space has "already begun to relieve some of the capacity pressures."

Dollar General's third-quarter stumble truly is a temporary matter. It's even arguable that the subpar fourth-quarter profit guidance is a sandbagged number meant to set up an earnings beat three months from now, as the retailer usually does.