Unless one commits suicide for reasons that are ultimately detached from reality, such as believing you must kill yourself because otherwise you'll be horribly raped by an invisible demon, it is a rational decision. That's because life can't solve any problem it didn't first create, and the goods can't meet any need that life itself didn't cause you to have.
Remove the need, and you remove all the negatives, without paying any price in deprivation of positives, since the value of that "good" would also be gone. The dead couldn't care less about what goods they would have experienced had they stayed alive, therefore, short of providing evidence of a worse afterlife, any claim that they are worse off for dying is but a case of living people projecting their own addictions onto the dead.
Based on that, and with exceptions such as the one above, suicide is a fully rational decision, because it aligns with the universal interest in avoiding unnecessary suffering. And all suffering in life is ultimately, in the grand scheme of things, unnecessary, because again it's not there for some noble purpose or necessity, it's there only because humans want life to exist. That they want it to exist doesn't prove that life needs to exist, or that its absence would be a tragedy, objectively speaking, however.