Are you a physician or a hospice worker? Because all of the ones that I have talked to stated that pain can almost always be managed without overdose. Generally the problem comes in when a person is already near death and the pain medication causes respiratory problems.
But you see you immediately call it a problem. If you are treating the pain with things such as morphine ( or even stronger drugs) then respiratory failure is ALWAYS a risk. You did not address the basic question which was how do you distinguish between the the desire to be out of pain and the desire to have life end because you know the pain ( and trust me it is excrutiating) will not end until you have ceased breathing. You treat “end stage” as if it is instantaneous and trust me it is not.