When Ashton Kutcher portrayed Steve Jobs in the 2013 movie "Jobs," he intensely studied and implemented the Apple co-founder's behaviors, including his unusual eating habits.

Kutcher opened up about how adopting Jobs' idiosyncratic diet impacted his own health on an episode of the YouTube show "Hot Ones," in September.

It was "the craziest thing," Kutcher said.

Famously, Jobs experimented on and off with a "fruitarian" diet, which is a strict vegetarian diet that emphasizes eating mostly fruit, as well as some nuts, seeds and grains. Jobs also would fast for periods of time, sometimes weeks or days, and he stuck to these eating patterns even while his health began to decline, according to Walter Isaacson's biography, "Steve Jobs."

Kutcher said Jobs was interested in the "healing properties" of fruit, and according to Isaacson's book, the Apple co-founder was turned on to the fruit diet in college after reading the book "Mucusless Diet Healing System" by Arnold Ehret.

Sometimes, Jobs would stick to eating a few specific fruits at a time, such as apples and carrots, according to Isaacson's book. Kutcher heard that Jobs drank a lot of Odwalla carrot juice, specifically, even to the point where his skin developed an orange hue. And Isaacson writes that Jobs stocked the Macintosh offices with Odwalla organic orange and carrot juices. (Odwalla did not respond to CNBC Make It's request for comment.)

"So, I started just drinking carrot juice nonstop all day long," Kutcher told "Hot Ones."

Then one night, Kutcher felt a shooting pain in his back, and had to go to the hospital. He says he was diagnosed with pancreatitis, which is inflammation of the pancreas, and put on a pain killer medication.

"My pancreas was like crazy out of whack," Kutcher said. (The pancreas is a gland that's responsible for controlling blood glucose levels, plus releasing insulin and other enzymes that help with the digestion of food.)

"Then I'm getting freaked out like, 'Oh my god I've become Steve Jobs.'" (Jobs died of pancreatic cancer in 2011, but eating excessive amounts of fruit does not cause pancreatic cancer.)

While fruit contains vitamins, nutrients and antioxidants that are beneficial for your health, experts warn against such restrictive diets — a diet of only fruit can put individuals at risk for nutrient deficiencies, such as essential fatty acids, as well as vitamin and minerals, Jeannine B. Mills, board-certified dietitian in oncology nutrition and member of the scientific and medical advisory board for the Pancreatic Cancer Action Network, tells CNBC Make It. This can lead to an array of health consequences, she adds. And an "overabundance of certain micronutrients from a concentrated intake of a select few foods" can lead to toxicity, she says.

It's unclear why Kutcher got pancreatitis, and other important lifestyle factors beyond diet that can impact a person's health, such as medications and underlying health conditions, Mills says. She advises against going on any sort of self-imposed diet without first discussing it with your doctor and a registered dietitian.

While it's been years since Jobs died, and the biopic premiered, fruitarianism has maintained its popularity among people in the vegan community.

But Kutcher has some advice from his experience: "Don't drink too much carrot juice," Kutcher said. "That's the moral of the story."

Don't miss:

Billionaire Jack Dorsey's 11 'wellness' habits: From no food all weekend to ice baths

Bill Gates says this is the Steve Jobs trait he envied the most

Productivity tips from Elon Musk, Jeff Bezos and Steve Jobs