So, this is in relation to cases where there is perhaps a certain person who presents a reasonable amount of harm to other people, either physically, or emotionally, or sexually or anything like that c"v. If a person were to make others aware of such an issue, as a matter of protecting him and them, either privately or publicly, and the person in question who commits suicide was unstable and actually did commit suicide, who'd be held chayav for the suicide? The unstable person or the guy who was protecting other people?
There will be a lot of variables here, and an individual's situation should be discussed with a competent rabbi.
Sefer Chafetz Chaim discusses at length the requirements for revealing damaging information. For instance, you had to warn Shprintza that her boyfriend Shmerel was hiding a terrible, life-threatening disease. Did you tell the whole wide world? Did they need to hear it?
But if all those conditions are met, then I don't see why this is different than the case of a rodef. Suppose Shmoe is an active shooter spraying his machine gun at innocents. I am obligated to stop Shmoe if I can safely do so, and to make an effort to use minimum force. If I can stop him by shooting him in the leg, then I do that. If I can't, or my aim's not that good, and I end up killing him, then halacha doesn't blame me.
I asked a guy who's in dayonus and he said that if such a person were to kill himself at an attempt of a person trying to help others and stop him from hurting other people, it's okay al pi halacha. Thank you for the input guys!