This has never happened in my life before - previously if you overdose on heroin you would still be given lifesaving treatment…
Lifesaving organ transplants are regularly denied on such a basis. There are always more people who need an organ than there are organs available, so they can't afford to waste one on anyone who can't be trusted to follow the doctor's orders to keep taking their anti-rejection drugs. Unless the doctor can point to you immediately quitting abusing heroin as evidence that you can be trusted, you're not getting an organ in that scenario.
Lifesaving organ transplants are regularly denied on such a basis. There are always more people who need an organ than there are organs available, so they can't afford to waste one on anyone who can't be trusted to follow the doctor's orders to keep taking their anti-rejection drugs. Unless the doctor can point to you immediately quitting abusing heroin as evidence that you can be trusted, you're not getting an organ in that scenario.