Halep, who won her first major title at Roland Garros in 2018, looked in control of Thursday's game when she won the first set and went a break up at the start of the second.
But teenager Zheng recovered to take the second set and establish an early lead in the third.
Halep, who looked to be struggling with her breathing, called on the trainer twice in the final set as she went on to lose 6-2 2-6 1-6.
Ahead of the French Open, Halep told CNN that she had come close to retiring from tennis last year as she recovered from a calf injury and struggled with the ongoing impact of the Covid-19 pandemic.
She said partnering with coach Patrick Mouratoglou earlier this year had "brought that fire back," but admitted after Thursday's defeat that the ongoing impact of the past two years is still taking its toll.
"I can understand why it (the panic attack) happened because I had two tough years with injuries and a lot of pressure with the pandemic and stuff," she said.
"So probably today I just broke down a little bit. My brain was not very strong. But now I'm good, and that's why I'm smiling."
Writing on Instagram, Mouratoglou acknowledged after the match that he is "not doing a good enough job" as Halep's coach and "expect(s) much better from myself."
Halep replied saying she is "ready for more."
The former world No. 1 earned praise 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 big titles and it just goes to show that it can happen to anyone," said Henman.
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 in the fourth round, the 2020 French Open champion who is on a run of 30 consecutive wins.