Playing her first competitive match in nearly three months, the 23-times Grand Slam champion twice came back from a break down but struggled on her first serve.
Defeat for Williams, who received an opening round bye in Rome, was a major blow to her preparations for the French Open, starting on May 30.
It was the American's 149th defeat in her 1,000 career WTA matches.
World number two Naomi Osaka also crashed out of the tournament, losing to American Jessica Pegula.
Osaka, a four-times Grand Slam winner, has often struggled on clay and her defeat in Rome followed a second-round loss at the Madrid Open this month.