I agree with you practically, but from devils advocate position if the reason we are saying the patient doesn’t have capacity to choose treatment setting is because they are going to imminently kill themselves otherwise, then why do we not feel that desire for imminent self harm will impact decision making on medication choices?
I think a missing piece is that we are not talking about "choice of treatment setting" in the sense of 'the office with the blue sofa v the office with the beige sofa." The idea that a patient could lack capacity to decide that but could make reasonable decisions about medications would indeed be incredible. But if voluntary v involuntsry treatment setting is a superordinate category of the treatment itself it is not at all strange that someone might lack the capacity to make the decision about hospital or no but would retain the ability to meaningfully decide amongst details that are a proper subset of the former decision.
A demented person might lack capacity to decide whether they should eat a meal today, but we have no trouble believing they have capacity to first eat the ham sandwich and then the applesauce or vice versa.
The choice the patient faces is 'given that these people will to a great extent physically prevent me from ending my life, which of these options of medication is most consistent with my desires?" Framed like this it is not that surprising that they mostly do not just choose the most lethal medication possible, at least absent an offer of a loading dose of sodium cyanide.