Praise be to Allah.
There is nothing in the Sunnah to indicate that the supplication of an insane person is answered, so it is not permissible to claim that unless there is evidence to prove it, and there is nothing in the evidence that bears witness to that. Perhaps the origin of this claim comes from exaggeration of the Sufis thought concerning the insane and the simple-minded, or from the way in which the common folk go to extremes in mistreating these insane people. Many people wrong them and mistreat them unlawfully, and others think that they are better than same people or that they have a high status in worship or a special status before Allaah.
Rather we go further than that and say that the supplication of an insane person is not based on understanding and knowledge, so it does not fulfil the meaning of supplication which is worship and which implies that the person who is offering the supplication has in mind the meanings of Divinity and Lordship and the might of Allaah, may He be glorified and exalted, and he has in mind his need and submission and humility before Allaah. If an insane person says supplication, he is only uttering words that he does not know the meaning of and does not intend what they imply. Can something like this be called supplication, let alone be claimed that it is accepted and answered by Allaah?
But some of these insane people, who are not accountable, may have some understanding of some things and may be able to distinguish between the one who treats him kindly and honours him and the one who mistreats him and scorns him, so he may say some good words and supplication for the one who is kind to him. He may also supplicate against the one who mistreats him and scorns him, and it is not unlikely that his supplication may be answered in that case, especially if he is wronged and is seeking help against the one who wrongs him.
But saying in absolute terms that the supplication of the insane person is answered is something for which there is no evidence; rather it is speaking about Allaah without knowledge.
And Allaah knows best.