The analogy is not 100% equivalent, as truckers in question are independent owners and operators.
Closer restaurant analogy would be someone opening a taco truck, and getting hired to cater a small event. California now says that whoever hires that taco truck is responsible for benefits and other labor regulations, so pay up or hire caterers from a well-established corporate entity like Wendy's. For analogy's sake let's also consider that the taco truck owner has already invested a six-digit amount into their [now useless] food truck.
This benefits large established corporations in favor of small independent businesses.
It helps no one, as truckers always had a choice to go work for one of those large corporate entities (the churn in corporate trucking is consistently high, which is why you tend to see those "We're hiring" signs on the back of the trucks) if they wanted a full array of benefits and schedule/routes set by someone in corporate. For whatever personal reasons (larger take-home income, benefits provided by spouse, ability to choose preferred routes, schedule preferences, etc.) they chose not to.
For what it's worth, labor law specifically carves out restaurant owners and their family members (including things like minimum wage). Truckers want the same carveout.