It's always punishing when growth stocks fail to live up to expectations, and investors in machine vision company Cognex (CGNX -0.02%) certainly weren't spared a sharp fall after it disappointed investors with its guidance at the time of the second-quarter results. However, since then the stock has recovered some lost ground. What exactly went wrong in 2015? And is it symptomatic of a deeper underlying problem?

CGNX Chart

CGNX data by YCharts.

Cognex's aims in 2015
Essentially, Cognex is trying to aggressively expand the Total Addressable Market, or TAM, for its ID product solutions. The company's core market is the automotive sector -- usually a leader in implementing automated manufacturing technology -- but Cognex has been making strides by expanding into markets such as logistics, consumer electronics, healthcare products, and food and beverage.

Turning to the specifics, there were three key reasons investors had a right to feel optimistic about 2015. First, Cognex's large deal with Apple in 2014 served to remind investors of the potential for future orders.

Second, management's previous commentary signaled some future deals to come. For example, on the first-quarter earnings call, CEO Rob Willett spoke of "large opportunities in consumer electronics and logistics" amid reminding listeners that "significant deployments" could be made "at relatively short notice" within these industries.

Indeed, at the time of the first quarter the company ramped up operating expenses by 6% in expectation of a "higher level of revenue expected later in 2015." Of course, an increase in costs implies some margin pressure, and as you can see in the chart below, Cognex's margins have declined in recent quarters -- largely to do with increased costs associated with servicing larger deals and the lower margin that such deals entail.

CGNX Gross Profit Margin (TTM) Chart

CGNX Gross Profit Margin (TTM) data by YCharts.

Third, Cognex managed to agree to the sale of its Surface Inspection Systems Division to Ametek, thereby freeing up management resources to focus on ID products orders.

All told, the market had good reason to believe that Cognex was set to sign some more large orders, particularly within consumer electronics and logistics.

What went wrong?
Unfortunately, things didn't quite work out as hoped. The second-quarter earnings presentation delivered some bad news for investors. Management spoke of slowing sales trends in the Americas and announced that they expected "fewer large orders in the second half of this year." In other words, don't get too optimistic about Cognex signing large orders in consumer electronics or logistics in the next couple of quarters.

Two considerations
I've gone into more detail in this article on the reasons management gave for missing estimates. Suffice it to briefly mention that management disclosed that the weakness was centered on nonautomotive customers -- precisely the kind of customers that Cognex is growing its TAM into.

At this point, investors should consider whether this is the kind of teething problem that occurs in growth companies, or whether it's a consequence of a weakening macroeconomic environment, or even whether the machine vision marketplace is set for some sort of secular slowdown.

Regarding the first argument, it's hard enough for many companies to accurately predict large order flow in their core end markets, let alone in new industry verticals. The macroeconomic worry is obviously a concern and the evidence from the last recession is that Cognex will surely suffer if the economy experiences a downturn.

Meanwhile, on the last earnings call Willett affirmed his belief that Cognex's factory automation business would grow 20% in the long term with ID products growing at 30%. All of which doesn't sound like there is any kind of secular weakness coming, at least according to Willett.

The takeaway
All told, in my view the disappointment with Cognex looks likely to be the typical kind of problem that occurs with growth companies. Unfortunately, it occurs at a time when other companies are reporting weakness in the industrial capital-spending market -- investors would be well advised to monitor macroeconomic events.

On the other hand, all it will take is one or two large orders to get filled in early 2016, or the signing of another large order, and the stock should surely move higher. If you buy the long-term story, now could be a time to buy the stock, but don't be surprised if the next quarter or two are relatively lackluster.