Locking someone up against their will for being suicidal will always be wrong in my mind.
You’re entitled to that opinion, of course.
Contemporary thinking, including that of the mental health care profession, is that thoughts of suicide are the product of illness, and that treatment options are available. Terminal illness or chronic suffering are an exception. If someone has an illness which causes them to harm themselves, it seems appropriate to intervene when no alternative options are available.
While I am sure that’s true for a lot of cases, I think you have to look at society and the individual as a whole. Lots of people are homeless or struggling to afford food, and they will never break out of poverty completely even if they manage to improve their situation a little. Add on to that the fact we are killing the planet, each other, and nature all at the same time and I don’t think suicide is that unreasonable in some cases. This is especially true for disabled people that can’t get jobs or have much quality of life and live on peanuts from the government if anything.
You’re also entitled to that opinion, but you have to acknowledge that it’s not commonly held, which is why people will prevent others committing suicide.
Maybe look at the upvotes to see which is more popular an idea? Nobody really stops homeless doing anything aside from getting a place to sleep. Euthanasia is also a pretty popular idea for people who are already dying.