Halep, the 2018 winner in Paris, was forced to call for the trainer after having difficulty breathing during the 2-6, 6-2, 6-1 loss to Chinese teenager Zheng Qinwen, who is playing just her second grand slam tournament.
Zheng won 11 of the last 12 games to advance to the third round of a grand slam for the first time.
Halep conceded after the match she "didn't know how to handle" the panic attack.
"I probably put pressure on myself too much, because I really wanted to do well," she said afterwards. "I felt good. I practice. I work hard. But it just didn't happen, and probably I got a little bit of panic during [the match] thinking, overthinking.
"But I was leading, so there is no reason, in particular, why it happened. But it happened, so I have to accept it. It's something normal that everybody has."
Halep said she had not previously suffered a panic attack.
"I didn't feel better during the match," she said. "If I would have felt better, I would have started to play a little bit better. No, I couldn't. That's why I said at the start I couldn't manage it, and I don't have many words about it. I just accept it, and I take it."
Zheng will now play Frenchwoman Alize Cornet, who is coming off a career-best quarter final run at the Australian Open.
For a daily dose of the best of the breaking news and exclusive content from Wide World of Sports, subscribe to our newsletter by clicking here!