A few years ago, Chef Robotics was facing potential death.

“There were a lot of dark periods where I was thinking of giving up,” founder Rajat Bhageria tells TechCrunch of his six-year-old company. But friends and investors encouraged him, so he persevered.

Today, Chef Robotics has not only survived, it’s one of the few food tech robotic companies that is thriving. The startup, which recently raised a $23 million Series A, has 40 employees and marquee customers like Amy’s Kitchen and Chef Bombay. Dozens of robots installed across the U.S. have made 45 million meals to date, Bhageria says.

This compares to a graveyard of failed food tech robotics companies, including Chowbotics with its salad-making robot Sally; pizza delivery robot Zume; food kiosk robot Karakuri, and, more recently, agtech Small Robot Company.

Bhageria says he saved his company by doing something that early-stage founders fear to do: turning away signed customers and millions of dollars in revenue.

It all began when Bhageria did his master’s degree in robotics at UPenn’s famed GRASP Lab. He dreamed of the sci-fi promised world where robots did our housework, mowed our lawns, and cooked us five-star dinners.

Such a world doesn’t exist yet because engineers have yet to fully solve the robotic grasping problem. Training the same robot to wash a wine glass without crushing it and a cast iron pan without dropping it is a difficult task.

When it comes to robotic chefs, “Nobody’s built a dataset of how do you pick up a blueberry and not squish it, or, how do you pick up cheese and not have it clump up?” he describes.

His original idea with Chef Robotics was similar to the long-list of the robotics startups that died: a robotic line for fast casual restaurants. That’s an enormous industry with a chronic employee shortage.

“We actually had signed contracts. Like we had multimillion-dollar signed contracts. Obviously, we’re not doing this anymore. So what happened?” he said. “We essentially could not solve the technical problem.”

In those types of businesses, an employee completes an order by assembling all the varied ingredients necessary for each meal. These restaurants want robots to replicate that process because the alternative is to have dozens of robots dedicated to, and calibrated for, a single ingredient, some of which may only be used occasionally (we’re looking at you, anchovies).

But Bhageria and team couldn’t build a successful pick-up-anything robot because the training data doesn’t exist. He asked his potential customers to let him install robots for one or two ingredients, gathering training data and building from there. They said no.