It's been a while, but I've read a theory once that depression, in this case, is a feature, not a bug. Meaning, it's an evolutionary mechanism for survival. In the context of what I read, the suggestion was about when someone suffered a setback or defeat, that the depression lowered motivation to do something reckless or drastic, forcing one to withdraw/retreat, so to speak, I guess to give time for reflection, and to plan a comeback of sorts. I don't remember if suicide was mentioned, but if that theory's correct, it wouldn't be much of a stretch to include depression as a form of SI in the removal of motivation to CTB.
I haven't read it, yet, but here's another article on the same subject, with the same thesis...
Some psychologists believe suicide and depression can be strategic.
nautil.us
Here's another one:
"Depression Starts with Immobilization"
"Eventually, if these modern triggers last long enough, the body decides it can't get away. Next comes immobilization which the body triggers to defend us. According to Porges, what we call depression is the cluster of emotional and cognitive symptoms that sits on top of a physiological platform in the immobilization response. It's a strategy meant to help us survive; the body is trying to save us. Depression happens for a fundamentally good reason."
Common wisdom says depression starts in the mind with distorted thinking. But newer models suggest depression starts when the body initiates a defense strategy to help us survive.
www.psychologytoday.com