Now if that patient had a living will, and it was acceptable to "kill the patient" by "overdose", then what you are saying could be done.
But, in my opinion, is what that gets down to.
For drugs like morphine, they now have "Patient Controlled Analgesics" (PCA), where the patient presses a button to administer a dose.
If someone else presses that button, they could be criminally charged. They basically could be prosecuted to administering morphine to someone.
My Dad didn’t want to die. He wanted to be out of pain. I kept thinking the whole time that here we are, with modern medicine and all, and it is still difficult, at times, to manage pain successfully.