In the case someone declare he isn t guilty, the standard practice in my country is to discourage seeking mental help of any kind during the investigation phase/discovery no matter how acute the suicidal risk is. The rationale is someone not guilty has total peace of mind the fairness of the system will make him declared not guilty. If not, this is a sign of remorse, or fear.
Though actually trying to kill yourself if of course a sign of guilt for jurors. Illustraded with an example where defendant lost on appeal after attempting to kill himself https://www.franceinfo.fr/faits-divers/justice-proces/affaire-elodie-kulik-ce-que-l-on-sait-sur-la-tentative-de-suicide-de-willy-bardon-lors-du-verdict_3734621.html ""Did you see his gesture? It's certainly the gesture of an innocent person," Jacky Kulik remarked ironically. (Interviewed by France 3)"
Medical discusions are covered par an evidentiary privilege here. But who you call (emergency suicide helpline), where you go who do you see (psychitrist/psychologist) and which prescription drug you take is not.
Also, in our system the personality of the defendent is always assesed first, that is, before the trial. Whether the defendent has the mind of someone doing illigal things.