Contrarian investing is much harder than it looks. It's easy to talk the talk, but putting your money where your mouth is isn't such an easy task when asset prices fall and Wall Street's experts pile onto a struggling business.

In spite of this -- or really because of it -- I'm going to vigorously defend the seemingly indefensible Dollar General (DG -0.41%). Stocks don't go on sale unless there are apparent problems, and Dollar General's problems are fully known, acknowledged, priced in, and probably not lethal to the company's long-term prospects.

Pain now for growth later

From a top-line perspective, 2023's second quarter wasn't terrible for Dollar General. The company's net sales grew nearly 4% year over year and same-store sales were nearly flat.

What prompted investors and analysts to turn against the company, it seems, was Dollar General's bottom-line miss and disappointing full-year forecast. As it turned out, the company earned $2.13 per share in Q2 2023 versus Wall Street's call for $2.47 per share. Moreover, Dollar General lowered its fiscal 2023 net sales growth guidance from the previous range of 3.5% to 5% to a new range of 1.3% to 3.3%.

The negative response was swift and severe. Dollar General stock tumbled 15% after already being down 36% year to date, and a litany of downgrades came from the likes of J.P. Morgan, Oppenheimer, Raymond James, and Evercore ISI.

Among Dollar General's challenges is "shrinkage" (which includes shoplifting). But this issue isn't limited to Dollar General as it's been a persistent problem for Dollar TreeWalmart, and other rivals. Indeed, Dollar General factored an "increase in expected inventory shrink" as well as "softer sales trends" (presumably due, at least in part, to financially constrained customers) in its aforementioned reduced sales outlook.

As for the company's poor quarterly earnings-per-share (EPS) result, it's not only baked into the share price now, but it's also somewhat attributable to the company's forward-looking investments. Dollar General has a host of real estate projects -- nearly 850 of them -- including store openings, relocations, and improvements/upgrades/remodels as well as "distribution and transportation-related projects."

The bad news that didn't happen

While I'm viewing Dollar General's glass as half full, here's another encouraging consideration. Despite the sales outlook reduction and the downgrades, at least Dollar General's shareholders were spared a dividend cut in the second quarter.

This shouldn't be underestimated. Even with the "shrink" and the shrinking revenue forecast, Dollar General chose to uphold its consistent track record of annual dividend increases. Currently, the stock offers a forward annual dividend yield of 1.84%, which is substantially greater than the sector average of around 1%.

Along with a firm commitment to rewarding its shareholders, Dollar General presents a good value that contrarian investors ought to consider. If it weren't for the company's less-than-stellar quarterly results and guidance, the stock wouldn't trade at around 13 times latest 12-month earnings versus the sector median of roughly 20.

Again, bargains typically only occur in the stock market when companies are having problems. By now, an efficient market has surely adjusted its expectations after Dollar General lowered its own outlook and acknowledged its issues, and after analysts put Dollar General in the penalty box.

And while I'm certainly not limited to buying just one stock, I find Dollar General stock highly enticing as the company continues to reward its shareholders and resists the temptation to downplay its headwinds. So if you truly believe in contrarian principles and the efficient market theory, feel free to wager a few dollars on Dollar General.