SAN FRANCISCO — After months of bickering over who would be covered by a landmark bill meant to protect workers, California legislators passed legislation on Wednesday that could help hundreds of thousands of independent contractors become employees and earn a minimum wage, overtime pay and other benefits.

But even before California’s governor, Gavin Newsom, had signed it into law, the battle over who would be covered flared up again. Uber, one of the main targets of the legislation, declared that the law’s key provisions would not apply to its drivers, setting off a debate that could have wide economic ramifications for businesses and workers alike in California, and potentially well beyond as lawmakers in other states seek to make similar changes.

“California sets off a chain reaction,” said Dan Ives, a managing director of equity research at Wedbush who tracks the ride-hailing industry. “The worry is that the wildfire spreads.”

In California, religious groups said they feared that small churches and synagogues would not be able to afford making pastors and rabbis employees. Winemakers and franchise owners said they were worried they could be ensnared by the law, too. Even some of the contractors for the app-based businesses that have been at the center of this debate said the change could hurt them if companies like Uber, Lyft and DoorDash decided to restrict how often they could work or cut them off entirely.