That's not actually true though is it, suicide is illegal in many jurisdictions. Not just self- euthanisation towards the end of life anyway (which is more controversial/media-discussed) but any form.
The laws that do target someone for being in an altered mental state are mostly about being that way in public.
There's probably also a crowd who want it to be illegal because they view suicide as a sin, though personally I think that justification for a law seems like a violation of religious freedoms.
If true, that sounds like survivorship bias (literally). Those who aren't happy about the failure will just try again and won't be counted in the statistics.
/s