Halep, who won her first major title at Roland Garros in 2018, appeared to have Thursday’s match under control as she won the first set and split at the start of the second.
But teenager Zheng recovered to take the second set and take an early lead in the third.
Halep, who seemed to be having trouble breathing, called the trainer twice in the last set and then lost 6-2 2-6 1-6.
Ahead of the French Open, Halep told DailyExpertNews she nearly retired last year as she recovered from a calf injury and struggled with the lingering impact of the Covid-19 pandemic.
She said the partnership with coach Patrick Mouratoglou had “brought back the fire” earlier this year, but admitted after Thursday’s defeat that the lingering impact of the past two years is still taking its toll.
“I can understand why it (the panic attack) happened because I’ve had two tough years with injuries and a lot of pressure with the pandemic and all,” she said.
“So probably I just kind of collapsed today. My brain wasn’t very strong. But now I’m good, and that’s why I’m laughing.”
On Instagram, Mouratoglou wrote after the game that he is “not doing well enough” as Halep’s coach and “expects much better of myself”.
Halep replied that she is “ready for more”.
The former world No. 1 has been praised for speaking openly about the panic attack, with Eurosport commentator and former player Tim Henman saying it was “so brave and so honest” of her to discuss what happened.
“She’s been around for many years, she’s won major titles and it just goes to show that it can happen to anyone,” Henman said.
Zheng will play in the third round of a grand slam for the first time in her career when she takes on Alizé Cornet on Saturday.
The world No. 74 could then face Iga Swiatek, the 2020 French Open champion who has won 30 consecutive wins, in the fourth round.