Osaka was beaten 6-4 6-2 by Katerina Siniakova as her quest to win a third grand slam in succession came to an end, while Williams fell to fellow American representative Sofia Kenin 6-2 7-5.
There were no such problems for reigning champion Simona Halep, who is the highest seed left in the draw after overcoming Lesia Tsurenko 6-2 6-1 in just 55 minutes.
Australia's Ashleigh Barty, the No.8 seed in Paris, will face Kenin after a 6-3 6-1 triumph over Andrea Petkovic, and there were also straight-sets win for 17-year-old Amanda Anisimova and Aliona Bolsova, who will meet in round four after overcoming Irina-Camelia Begu 7-6 (8-6) 6-4 and Ekaterina Alexandrova 6-2 7-5 respectively.
Madison Keys overcame Anna Blinkova 6-3 6-7 (5-7) 6-4 to advance to a clash with Siniakova, and teenager Iga Swiatek recovered from being bagelled in her first set to win 0-6 6-3 6-3 and set up a match with Halep.
Osaka was guaranteed to hold on to her position at the top of the rankings after Karolina Pliskova exited at the hands of Petra Martic on Friday, but 24 hours later the Japanese was on her way out too.
The US Open and Australian Open champion had to come from behind to beat Anna Karolina Schmiedlova and Victoria Azarenka in her opening two matches and she could not do it a third time.
Osaka suggested the pressure of entering Roland Garros as the world number one made it difficult for her to play with the same freedom.
"I think this tournament I have had a feeling that was different to the other grand slams that I have played, because usually I find it very freeing and fun, and this time around I was kind of tense the entire time," the Australian Open champion said.
GRAND SLAM TITLE 24 REMAINS ELUSIVE
Williams's hopes of emulating Margaret Court at Roland Garros by winning a 24th grand slam title were dashed by Kenin.
Kenin performed brilliantly to reach the last 16 of a major for the first time in her career, meaning Wimbledon is Williams's next chance of getting the record-equalling piece of silverware.
Having struggled with a left knee injury in recent months, Williams admitted she feels short of matches and is considering playing on grass in the lead-up to Wimbledon for the first time since featuring at Eastbourne in 2011.
NO WORRIES FOR HALEP
Halep may have flown past Tsurenko but she suffered three breaks of serve in doing so. However, the reigning champion was not overly concerned and was pleased to get the job done so quickly.
"I was not worried, because losing my serve is happening often," Halep said with a smile. "I'm very confident on my return, so I didn't think something negative. I just looked forward for the next point.
"I expected a tough one, because I was always in trouble in the second set when I played against her.
"I think today was a better match. I played better. And I felt better on court."