It's always interesting when a growth stock stumbles, not least because it can create a compelling buying opportunity. That's possibly the case with machine vision specialist Cognex (CGNX -0.59%). The company disappointed investors with its recent earnings, as 2022 turned out to be weaker than hoped, and the outlook for 2023 was also uninspiring. What's going on, and is Cognex a stock worth avoiding or one to buy on the dip?

Cognex disappoints investors

As CEO Robert Willett put it on the recent Q4 earnings call, "Our fourth-quarter results were largely in line with our guidance, but are not representative of our long-term growth expectations."

Cognex's Q4 sales declined by 2% compared to the same period last year, and its full-year sales fell by 3% versus 2021. Management doesn't offer full-year guidance, but its first-quarter forecast for revenue of $180 million to $200 million compared unfavorably to $282.4 million in sales in Q1 of 2022. It gets worse. Management guided toward first-quarter gross margin in the low-70% range compared to its long-term target level in the mid-70% range.

What went wrong

There are three main factors to consider around Cognex's earnings and guidance. First, the company suffered a loss of inventory last year due to a fire at a primary contractor. The fire forced Cognex to purchase higher-priced components from brokers in order to replenish inventory. It resulted in a $40 million increase in costs -- enough to drop Cognex's 2022 gross margin to 72% from 76%. However, the good news is the company expects a $25 million to $35 million reduction in that expense this year as it winds down buying from brokers. 

Second, management spoke of a weakening economic environment, with Willett noting that he was seeing "a broader slowdown across many of our end markets as customers are wary of committing to significant investment," contributing to a "slow start to 2023."

Third, Cognex is seeing a significant slowdown in its largest current market -- logistics -- and specifically in machine vision systems in e-commerce fulfillment centers. A quick look at the company's main end markets shows the extent of the decline in 2022.

Main End Market

Share of Revenue 2022

Management Commentary

Automotive

25%

Up 13% (constant currency basis) in 2022

Consumer electronics

20%

Up mid-teens percentage (constant currency basis) in 2022

Logistics

20%

Declined by 25% in 2022

Data source: Cognex presentations. 

Cognex has two large customers that, respectively, accounted for more than 10% of revenue within consumer electronics and logistics. Apple was previously identified as a major customer, and based on analysts' questions and management's answers to them, I would bet that the unnamed large logistics customer is Amazon.com.

What tanked Cognex's logistics earnings

In a nutshell, e-commerce companies, and notably Amazon, are pulling back on large-scale investments in e-fulfillment centers as they pare back spending following a pandemic-inspired surge. In addition, the slowing economy is encouraging them to sit on their hands even more. 

For example, on Amazon's recent earnings call, CEO Andrew Jassy said his "No. 1 priority" is trying to reduce "our cost to serve in our operations network" while also pointing out that the company had doubled the "fulfillment center footprint" it had built over the previous 25 years in the last two years alone.

It's not just Cognex that's feeling the pinch. Honeywell (HON 1.66%) has a warehouse automation business, Intelligrated, within its warehouse and workflow solutions segment. It's also seeing a significant slump in revenue. Although it's not an apples-to-apples comparison, it serves to highlight just how dramatic the increase in 2021 revenue was versus the decline in 2022, with weak conditions persisting in 2023.

Chart showing Honeywell warehouse and workflow solutions sales growth over the past nine quarters.

Data source: Honeywell presentations. YOY = year over year.

Is Cognex stock a buy on the dip?

I think there's a strong case to be made for the stock. The impact of the fire will dissipate through 2023. Honeywell's management believes its warehouse automation end market will bottom out in 2023, leading to growth in 2024. It looks more like a pause in a market that had previously surged rather than a structural decline. If that plays out, then Cognex's logistics revenue is also likely to grow next year. Meanwhile, the company continues to have excellent prospects in automotive (not least EV and EV battery-related spending). As for consumer electronics, Cognex could benefit from spending on the development of premium smartphones. We'll get more color on that in May when management has a clearer view of orders in consumer electronics.

As such, the dip in the share price is a useful buying opportunity for long-term investors, particularly now that expectations have been reset for 2023 in light of the weakness in e-commerce fulfillment spending.