We were specifically told in an earlier episode that Yvette was on medication for her condition but had stopped taking those meds on that last tragic day. So there was no aversion to doctors or to treatment, in general. She did what a lot of people who struggle with mental illness do - stopped taking her meds because she felt better, and then spiralled because it was the meds that were making her feel better. All those flashbacks we saw were of a single day. On that day, Yvette was off her meds. She spiralled into a manic episode while playing hide and seek with Jean Luc, took him down to the tunnels to play there, but he got stuck and she ran off. Maurice found them and had to drag Yvette out screaming, because she was so lost in her delusion that she could no longer distinguish reality from fantasy. He locked her into a room for that one night, because in that moment she was a danger to herself and others. Nothing in the story says that he wouldn't have sought help for her in the morning - it seems almost certain that he would, based on what we know. He just wanted them all to get through the night first. But while he was asleep, Yvette persuaded Jean Luc to open the door and then used the opportunity to take her own life.