This actually has merit. It doesn't mean people can't be suicidal as aberrations... but over generations, the people most likely to actually kill themselves would have done so... but, there are also people who have children before their suicides... so the suicidal tendencies would be passed on even though those people did die. So... there's your loophole. It only works if everyone died without having children.
A good example might be hemophilia. Women can have it, but it is rarer and often presents milder than it does in males. If you think about it, historically, IF girls were born with full-on hemophilia then if they survived to puberty, once menstruation started they would probably have died out in the pre-pre-modern medicine days when nobody knew what the hell was happening. Men, however, could survive having hemophilia if they happened to be fairly lucky and not get bruised/cut... so much easier for a man in the "caveman" days to survive that disease than a woman.
But, doesn't mean women can't get it or get a version of it... just makes it rarer.
So, suicide might be rarer because of historical suicide-prone people offing themselves and not procreating... but it can still be there to some degree in everyone else.
Evolution is a funny thing. It only "counts" as a trait for evolving if it is a thing that you live better with it and can't live without it... so things that are somewhat neutral can stick around... It's why people are still stupid. You'd think really stupid people would have died off generations ago... but stupid people can survive a lot of shit, sometimes it is even a weird advantage... so while smart has advantages in most cases, it isn't 100% necessary to survive in the world... so you get to keep the stupid in circulation.
Survival of the fittest ends up being a bit overstated really.