In one of the more thorough studies on this, in Germany about 15 years ago, almost 40% of participants had voluntarily weaned themselves off with slowly decreasing doses after two years. Nearly all had decreased their use of street drugs. Nearly all were housed, some 60% were employed. Most persons admitted to the program had been homeless and and all were unemployed at the start. The average duration of heroin use was more than 20 years.
That is a remarkable result. It led to Germany making maintenance therapy generally available for addicts. And it keeps being repeated. There's a large body of evidence supporting the slow self-guided taper for benzodiazepine addiction as well, and a small but growing body that suggests it may work for a great many kinds of various addictive drugs, including stimulants. If we minimize the social and economic chaos to the addict by simply giving them their drug, that give them the opportunity to choose to stop using it. It's an uncomfortable proposition, counterintuitive to some, but the study results are compelling and must be wrangled with.
The rest of the world disagrees with your assessment.
https://drugpolicy.ca/our-work/issues/heroin-assisted-treatm...
If that's your standard, it's already a failure. You are never going to "safely" allow heroin on the street. You're never going to "safely" allow children's playgrounds.
All prescription heroin is going to be is something that anyone who wants to ever have a better life (free from the record of having taken heroin) will avoid. Imagine if alcohol were only available by prescription, ideally paired with mental health services. In fact, you don't have to, because prescription alcohol was available during prohibition.
edit: Hell, prescription opiates are available everywhere, and it turns out to be a bit of a problem.