The former world number one cut a frustrated figure for long periods of his clash with Spain’s Roberto Bautista Agut, the 13th seed.
When he missed a simple forehand during the second-set tie-break, Djokovic pounded his racket against the ground before stomping off to unwrap a new one.
The Serbian is seeded 20th following his recent absence through injury, which necessitated a minor operation to ease an elbow problem earlier this year.
Yet the elbow certainly did not seem to be troubling Djokovic as his racket bore the brunt of his irritation.
Nevertheless, the 2016 Paris winner eventually found a way past Bautista Agut, winning 6-4 6-7 (6/8) 7-6 (7/4) 6-2.
And his route deeper in the tournament may have been made a little easier, too, after fourth seed Grigor Dimitrov bowed out.
Djokovic will instead meet another Spaniard, Fernando Verdasco, in the last 16.
Bulgarian Dimitrov won the ATP Tour Finals in London last year, but his wait for a grand slam title will go on after a 7-6 (7/4) 6-2 6-4 loss to the 30th seed.
Verdasco has now reached the fourth round at Roland Garros seven times, but he has yet to progress any further.
Second seed Alexander Zverev, along with Djokovic seen as one of the few genuine challengers to 10-time champion Rafael Nadal this year, was taken to five sets for the second time.
In the match of the tournament so far, the 21-year-old German was up against it trailing 2-1 to Damir Dzumhur.
Amid some spectacular rallies Dzumhur was playing shots far above his ranking of 26, and the Bosnian forced two match points in the deciding set.
But he put the second, a simple forehand winner, into the net and Zverev survived before going on to register a 6-2 3-6 4-6 7-6 (7/3) 7-5 victory in just under four hours.
— Eurosport UK (@Eurosport_UK) June 1, 2018
The Russian lost six games in a row during her first-round victory over Richel Hogenkamp and had to dig deep again to beat Donna Vekic in round two.
Serving for the first set at 5-3, Sharapova allowed the world number 52 from Croatia to break back before eventually getting over the line 7-5.
She dropped serve early in the second, and later served for the match at 5-3 again, with the same outcome.
However, Sharapova recovered to triumph 7-5 6-4 to keep her first Roland Garros campaign in three years on track.
This time last year Sharapova had recently returned from a 15-month doping ban, but she had not built her ranking high enough to qualify and was not offered a wild card.
But 12 months later Sharapova is back in the world’s top 30, seeded 28th at Roland Garros and a potential challenger for the title.
She will face Karolina Pliskova, the sixth seed, in the third round.
Wimbledon champion Garbine Muguruza, the 2016 Paris winner, had a more comfortable route into round three.
The Spaniard was rarely troubled in a 6-4 6-3 victory over French wild card Fiona Ferro to set up a meeting with Australia’s Sam Stosur.
“It’s always tricky when you face a young, talented French player,” said Muguruza. “It probably wasn’t the best tennis out there but I’m happy that I managed to fight and to win.”
Stosur knocked out 30th seed Anastasia Pavlyuchenkova of Russia.
The Romanian, a two-time runner-up at Roland Garros, found herself 5-0 down to American Alison Riske in Wednesday’s opening match on Court Philippe Chatrier.
Riske went on to take the first set but Halep finally woke up and dropped just two more games in registering a 2-6, 6-1, 6-1 victory.
Halep, still hunting a maiden grand slam title, will face another American, Taylor Townsend, in round two.
Halep refused to blame the rain delay, which prevented her from playing Tuesday evening, for her sluggish beginning.
“I had a slow start because it’s always tough to start this tournament,” she said.
“It’s a pleasure to come here and to play, so always I feel nervous at the beginning.
“But it was good that I came back so strong. I felt really well in the end of the match, and that’s the most important for now.”
In the second round, fourth seed Elina Svitolina, of Ukraine, breezed past Slovakian Viktoria Kuzmova 6-3, 6-4.
Petra Kvitova, the Czech eighth seed, was untroubled by Lara Arruaberra of Spain in a 6-0, 6-4 victory to take her into the third round, where she will face Estonia’s Anett Kontaveit.