This question is worth a whole book and it has been the subject of intense debate in moral philosophy. Since I can hardly write a book here the short answer is that if individual well-being is negative (more negative life experiences than positive ones factoring in the 'weight' of those experiences), this can't be remedied in a for the concerned individual acceptabel way and the suicide is not unduly painful it would follow said suicide is indeed rational.
The rub of course lies in being able to objectively assess one's situation and this could often pose a problem given that humans aren't primarily rational creatures (which is ironically why we have persisted up till now inspite of everything) and prone to emotions clouding one's judgement.
Which is why it would be better if humane suicide were legal under the condition that it'd be rational: if others could safely be consulted there'd be a much higher chance it wouldn't be a spur-of-the-moment thing and the assessment would indeed be rational. If that is the case the ethical and humane thing to do is to provide painless means so the individual doesn't have to suffer needlessly.
Of course society's standard for rationality (reflected in the supposed social and medical sciences that study suicide) is that of a robot without any emotions whatsoever whose sole aim is the well-being of others. Which usually means suicide is only considered 'rational' if the individual is no longer of any use to society, e.g. terminally ill.
As to mental illness: while it's possible irrational thoughts are clouding the issue long-standing mental illness that can't be cured or at least treated to the point of making life worth living again for the individual is an undoubted source of oftentimes extreme pain making wanting to escape it (provided the disorder in question cannot be remedied) pretty rational imo.
It's a myth that suicide always involves mental illness (as confirmed by the World Health Organization:
https://www.who.int/mental_health/suicide-prevention/myths.pdf, page 4): sometimes people are in objectively very bad situations that they can't get out of except by taking their own life. Misantrophe's fire metaphor is very apt indeed.
In summary: yes I do think rational suicides exist and probably occur much more frequently than society acknowledges. There are probably a multitude of reasons for this but some of the main ones would certainly be that society needs contributing members and one of the most important functions of society is to provide meaning to the life of its members and a mental barrier to death which is usually feared above all else.
In a way suicide oftentimes indicates failure of society especially in social, medical and economic situations that could have been reasonably remedied. There's no good reason for poverty to still exist in affluent societies (a major source of suicide one would assume): that it still does is because society apparently deems it necessary that certain individuals need to be as rich as the ocean is deep (beyond all reason) and it doesn't matter if this is at the expense of many others who lead materially horrible lives.
In short: imo society is largely immoral and does not have real moral authority to legislate against suicide. That it still can is clearly due to the fact that the majority of people are somehow content with this situation although they probably don't really comprehend it untill they are placed in a very adverse situation which awakens the desire for non-existence.