No, I don´t think it would be good idea to leave the children at their parents who suffer mental illness. It would risk the children´s life if they stay with them.
It would be different if the parents are agree to have professional help (therapies) to cure their mental healthy for their children´s sake.
Example about 2 cases:
I don´t know if you know the story about an American lady named Diana Downs who shot her 3 children somewhere in Oreoans last 1983. One of three children are killed. The reasons is Lew Lewiston, her married lover because he never want to be father. She did it for him.. What a crazy... She was put in prision for life sentence... She´s still in prison... Did you heard about this situation? She suffered mental illness due sexual abuse by her father in the past... She should leave her children at grandparents if she think she´s not good mother enough... The processor & his wife adopted her 2 children... They lived happily with them.
The 3 years old girl here was murdered by her mother´s boyfriend at few months ago because she´s daughter of "bastard". Her mother watched what her boyfriend did to her daughter is shaved her hair, beat her up, burnt her body with cigarettes etc. etc.
The reason is because that mother don´t want to "lose" her boyfriend.. Crazy, isn´t she? I can´t image of watch my boyfriend hurt my children... NO WAY..
They found out that the mother is also mental illness, too.
That´s why I don´t think it would be good idea to leave the children at their parents with those healthy situation.