I agree there are parallels between cases of chronic pain, but I also think there are significant differences. Someone with just chronic pain might think "This pain is too much. I don't have it in me to suffer anymore" whereas a depressed person often causes their suffering with distorted thoughts like "I am always depressed. I have tried everything possible there is to try to get better. No one likes me or wants to be around me. Everything is hopeless. I have no reason to live"
But that's the point, right? Depression causes so much pain that some people decide it is better to end their life rather than suffer. I don't see how it's any different than someone in chronic pain from any terminal illness desiring physician-assisted suicide. Of course their decision is affected by the pain they're suffering. That's the whole point.