Short answer. Yes, unsoundness of mind is a ground for annulment, but only if it existed at the time of the marriage. A condition that developed afterwards does not qualify, and the ground is lost if the party freely cohabited with the other after coming to reason.
What the law says
(2) That either party was of unsound mind, unless such party after coming to reason, freely cohabited with the other as husband and wife;
Family Code, Article 45 — Grounds for Annulment. Read the full provision →
The condition must have existed at the ceremony
The grounds for annulment are introduced by a phrase that governs every one of them: they must be causes existing at the time of the marriage. Unsoundness of mind is no exception. What is being attacked is the consent given on the wedding day, on the footing that a mind not functioning could not give it. A spouse who was well when they married and became ill years later has not supplied this ground, however severe the illness now is. The question is always the state of the mind at the moment consent was exchanged.
Unsound mind is not the same as psychological incapacity
These two are constantly confused, and they lead to different cases with different outcomes. Unsoundness of mind is a ground for annulment, which treats the marriage as valid until a court sets it aside. Psychological incapacity is a separate concept that renders a marriage void from the beginning, and it concerns an inability to comply with the essential marital obligations rather than an inability to understand what was being agreed to. Choosing the wrong theory is one of the more expensive mistakes in this area, because the evidence each requires is not interchangeable.
Cohabitation after coming to reason destroys the ground
The clause carries its own defeat: the ground is unavailable where the party, after coming to reason, freely cohabited with the other as husband and wife. The reasoning is that a person who regains capacity and then chooses to live as a spouse has ratified the marriage they could not validly enter. Note the two elements. The cohabitation must come after lucidity returned, and it must be freely undertaken, so living together under pressure, under confinement or out of dependence is not the same thing. This is the defence the other side will raise first.
What such a case needs from you
Everything turns on the medical record as it stood before and around the wedding, so the useful material is contemporaneous: hospital admissions, prescriptions, records of confinement, guardianship papers, and the accounts of people who saw the party in the weeks either side of the ceremony. Just as important is a truthful chronology of the marriage afterwards, because the periods of lucidity and of living together will decide whether the ground survives. Take the records and the chronology to a lawyer together rather than describing the situation from memory.