We've had this for years, unfortunately. When my ds was 7 I fought with him for ages as he kept trying to grab sharp knives and other sharp objects as he wanted to hurt himself and he will often bang his head on a hard surface if angry. Once when he was in Year 2 I had the headteacher phone me and ask me to take him home for the afternoon as he had completely lost it and was just lying on the floor and saying he'd rather be dead etc etc., which I think they thought was pretty worrying.
On another occasion when he was 8 he threatened to strangle himself with a tie and the very worst was last year when he was just nine where he lost it completely and I spent an hour trying to stop him harming himself (he has a children's tool box but with proper tools) and then when I finally managed to contact a neighbour and bring her in to help he locked himself in the bathroom and was threatening to hurt himself with a pair of scissors. He refused to come out and I was so terrified about all the possible dangers I ended up calling 999. He did eventually come out and calm down but that must have been the worst day of my life. Then and on other occasions he says how the world would be a better place without him and it's heart-rending.
Thankfully things have been somewhat less awful for the last year the majority of the time and we've done things like hide the toolbox and loosen the locks on the doors so they can be opened by a grown up pushing against them, but he often runs off and stays out for an hour or more when he's angry and I'm really worried that he'll jump into the river or something. It's always worst when he's over-tired and I'm actually dreading next week as he's gone away for the weekend with a group he's in after just coming back from a school residential week (only recently realised the two were back to back and he was determined to go to both).
Is your dd very bright or a bit of a social misfit in some way, which means she's maybe bullied at school? Forgive me if that's not the case but my ds doesn't really fit in, gets teased a lot and I think feels very lonely at times, which must contribute to his low self-esteem.
I did speak to my GP after the incident last year and he referred ds to the CAMHS team (Children and Adolescent Mental Health Support, I think), which was helpful, and maybe that's what your dd and you need.