California’s new medical marijuana laws were supposed to provide more structure and clarity for the state’s loosely regulated, billion-dollar industry, but in the past few weeks, dozens of municipalities have ignored that intention by moving quickly to ban delivery and other activities codified by the legislation.

Advocates and legislators hope the bans are only a minor setback in the effort to show federal regulators and voters that California — the first state to legalize medical marijuana two decades ago — can provide order to a medical weed sector that has been haphazardly regulated.

The potential political side benefit for weed advocates: Having a well-regulated medical marijuana system in place could help voters feel more confident that California will be able to manage a system of recreational marijuana for adult use, which is expected to be on the November ballot.

“This is a small hiccup along the long road toward a great success,” said Assemblyman Rob Bonta, D-Alameda, one of the principal authors of the bipartisan legislation.

Others aren’t so confident.

Part of the reason for the exodus of support is rooted in what legislators admit was a “drafting error” mistakenly left in the final version of the Medical Marijuana Regulation and Safety Act during the frantic last few hours before the Legislature passed it and Gov. Jerry Brown approved it in October. A provision written into the law said that if cities didn’t adopt their own land use regulations for allowing medical cannabis cultivation permits by March 1, the state would assume that responsibility.

Legislators meant to cut the mandated deadline, but it remained in the final version of the law. Assemblyman Jim Wood, D-Healdsburg, one of the leading authors of the package of bills that make up the new law, soon acknowledged the error and his intention to correct the mistake as soon as the Legislature reconvenes next week. Brown supports the change, said Wood and other legislators.

But many municipal leaders didn’t seem to hear that and quickly began passing laws, for fear of having the state write more lenient ones.

Wood tried to tamp down the panic by telling cities and counties in an open letter this month that even if his effort to quickly fix the law doesn’t pass before March 1, “the Bureau of Medical Marijuana Regulation, the entity responsible for developing the state’s regulations, currently exists on paper only. It will be many months before the bureau has the capacity to develop and enforce statewide regulations.”

Thirty municipalities have enacted bans on various aspects of cannabis cultivation, 20 have a ban pending approval, and another 20 are considering one.

In addition, 26 municipalities have voted to ban medical marijuana delivery in recent weeks and a dozen are about to, according to cannabis industry advocates tracking the legislation. Another 22 are considering a ban on delivery.

Many of these municipalities are Southern California and Central Valley communities that are less supportive of cannabis and already had some form of regulation in place. Some Bay Area cities like Gilroy and Sonoma have passed or reaffirmed restrictions on cannabis delivery or cultivation in the past few weeks, and others like Vallejo are considering them.

“If the city doesn’t strengthen the current laws we have on the books, then what we end up with is the state taking over,” Gilroy police Capt. Kurt Svardal told the Gilroy Dispatch last month. “And that’s what this is about: making sure we’re still having what our community wants.”

Even though the new statewide law includes provisions that enable municipalities to enact their own zoning laws concerning cannabis cultivation and delivery, advocates were disappointed to see cities quickly passing tighter restrictions. Advocates had hoped that the new regulations would make cities and counties more secure in being able to treat the cannabis industry like any other business, complete with requirements and regulations and a fee structure.

The result could leave some medical marijuana patients living in “medicine deserts,” said Liz Conway, whose public policy firm Gide advises cannabis business across the state. Delivery service is particularly important to medical cannabis patients, who may be suffering from debilitating illnesses and can’t hop into a car and drive to a dispensary.

“If they can’t access their medicine from legal means, will they get their medicine from the underground then?” Conway said. “We live in a bit of a halcyon area in the Bay Area, where you can take a trip to” plenty of nearby dispensaries. That’s not the case elsewhere, she said.

Bonta worried that many municipalities are “feeling a false pressure and they’re banning it as a simple and quick step to avoid a deadline that’s not there. We’re going to take care of it.”

Joe Garofoli is a San Francisco Chronicle staff writer. E-mail: jgarofoli@sfchronicle.com Twitter: @joegarofoli