The problem is that “mentally sound” is partially defined as not wanting to die. It doesn't matter how stable and coherent you are, as long as you keep saying “on net, I don't feel like my life has been worth living and I would prefer to end it painlessly if I could”, they will not let you out. Getting out is a process of learning the lies you need to tell the doctors and nurses.