On Sept. 30, 2016, in a Los Angeles suburb, 48-year-old Michael Zinzun, a homeless man on the California sex offender registry, approached a woman sleeping on a park bench and reportedly asked if she wanted to smoke meth. When she turned him down, he allegedly started sexually assaulting her. As she screamed, he dragged her away, pushed her over a three-foot retaining wall, and then raped and tried to strangle her, according to charges filed by the Los Angeles district attorney and local reports. The woman survived, and Zinzun is facing life in prison for rape, kidnapping, and other charges.

Cases like this might seem to argue for even tougher controls on ex-offenders convicted of sex crimes. But new research indicates that the existing sex-offense regime in the US actually may be making repeat sex crimes more likely.

Since the mid-1990s, legislators have devised increasingly byzantine rules for those who have been punished. Those include sending out postcards when an offender moves to a neighborhood, placing warning signs outside offenders’ homes, setting restrictions on what offenders can do on Halloween, and devising “presence” restrictions banning them from places like parks, malls, and museums where children might be present. That ever-tightening leash has produced unintended outcomes with an almost mechanical predictability. Many cities have devised new no-go zones that keep them from living near places like school, parks, and daycares and have seen their homelessness rates spike as a result.

The number of parolees who’d committed a sex crime who were homeless rose from 88 to almost 2,000 in five years.

California passed a law in Nov. 2006 forbidding parolees who’d committed a sex crime from living within 2,000 feet of schools or parks. Less than five years later, the number of them who were homeless had risen from 88 to almost 2,000. In Oct. 2014, Milwaukee passed an ordinance banning many registrants from living within 2,000 ft of schools, parks, day cares, recreational trails, and playgrounds. The number of homeless registrants promptly soared from 15 to 230 in less than two years, according to an analysis in Oct. 2016 by the Milwaukee Journal Sentinel.

Now, new research suggests making it harder for offenders to find a place to live might increase reoffending. In a study released in July 2016, researchers from the California and Canadian justice departments looked at more than 1,600 California sex offenders on probation or parole. Overall, the group’s sex-crime recidivism rates were low–less than 5% during the five-year follow-up period. But those who were homeless were over four times more likely to commit a repeat sex crime than those who weren’t. “Collectively, transient status seems to be associated with higher sexual recidivism rates,” the researchers concluded. That’s likely because those who lack stable homes, jobs, and social connections are more prone to reoffend.

The California Sex Offender Management Board, created by the state legislature and made up of law enforcement officials and other experts, issued a stark warning in a 2011 report: “The Board believes that the rise in homelessness among sex offenders needs attention because it is so closely associated with an increased level of threat to community safety.” An earlier board report had cited nine studies, including from Australia and Great Britain, all of which found a link between homelessness among ex-offenders (including sex offenders) and higher re-offense rates.

It’s not just residency bans that may increase crime. Sex offender registries—publicly posting ex-offenders’ names, photos, and personal information—appear to raise re-offense rates as well. Only the US, the UK, Canada, a few Caribbean countries, India, Chile, and South Korea operate public registries. But US registries, which are state run, are far and away the most extensive in terms of the number of people registered, length of registration, and degree of public access. (No country outside the US appears to restrict where registrants can live.)

In a 2011 paper in the Journal of Law and Economics, researchers from the University of Michigan and Columbia University looked at sex crime data from 15 US states over about 10 years. They found that the average-sized public sex offender registry increased the number of sex offenses by about 1.6% in the period studied, from about 9.2 sex crimes per 10,000 people to 9.3. That might seem small, but extrapolated to the US population it meant about 4,700 additional sex crimes during that period, says co-author J.J. Prescott.

“We have an anti-reentry policy for sex offenders.”

Prescott told Quartz those findings shouldn’t be surprising. Policies like alerting people to the presence of sex offenders or restricting where they live would intuitively seem to decrease risk. But that’s a static way of looking at the problem, he says—those policies themselves can make returning to prison look more desirable since ex-offenders find it hard to get housing, find a job, and form social bonds. “We have an anti-reentry policy for sex offenders,” Prescott says.

The resulting crime-generating effects may be playing out in Wisconsin. In May 2016, in the Milwaukee suburb of Waukesha, which has its own residency ban, a sex offender with no place to go after prison got himself re-arrested on the same day he was released by purposely standing next to a school. He’s now behind bars for two more years.

At least he didn’t commit another sex crime. That same month, another homeless sex offender in Milwaukee was arrested for allegedly masturbating in front of a woman while staying at a friend’s house a few weeks after he was released.

Alissa Ackerman, a University of Washington criminologist, has authored numerous studies on sexual victimization and sex-crime policies over the last decade. Because sex-offender registration makes finding a job and housing more difficult, offenders feel angrier and more stressed, she says. The public may not care how registrants feel but they should—her work indicates that these negative emotions drive up recidivism rates, she says.

As the evidence of perverse effects piles up, judges are taking notice. In the last month, federal courts in the Fourth and Seventh Circuits have struck down state or local residency or presence restrictions. Four months ago, Sixth Circuit judges overturned a residency and presence ban in Michigan.

Some legislators are paying attention too. In Ohio, a legislative committee is looking at getting rid of residency restrictions as part of a package of other changes to the state’s sex offense laws. In Texas in Aug. 2014, the Dallas city council set aside a proposal to impose residency restrictions after questioning whether it would actually improve public safety. And in New Hampshire in 2014, the state House voted to eliminate residency restrictions.

When citizens get triggered, adrenaline swamps deliberation.

Still, when citizens get triggered, adrenaline swamps deliberation. Take Minnesota, where in 2016, two unrelated news events collided to produce a hurricane of outrage. On Sep. 3 came the discovery of the body of Jacob Wetterling, who’d been kidnapped, sexually molested, and killed in 1991 by a serial child molester. On Sep. 7, the state announced it would release someone from the state’s sex offender civil commitment program—the first such instance after a federal court found the program unconstitutional.

In response, at least forty Minnesota towns have passed residence bans on registrants. The city of Dayton’s bars ex-offenders from living within 2,000 ft of, among other places, churches, seasonal pumpkin patches, and apple orchards, and makes virtually the entire city off limits to offenders. Dayton’s mayor didn’t respond to requests for comment on why the city passed the ordinance. Nor did Milwaukee alderman Tony Zielinski, who sponsored Milwaukee’s 2014 ban.

Statements by law enforcement officials have had some effect in previous debates. In New Hampshire, the state police convinced House members that by increasing homelessness, residence restrictions made it harder for them to track offenders. In years past, criminal justice officials in Kansas and prosecutors in Iowa have made similar arguments.

That case for crime prevention could halt momentum toward harsher policies in some situations. “Purely on public safety grounds,” says Prescott, “these laws are very questionable.”