Where is it forbidden for someone with mental problems to have a caretaker present? It appears that this is not a black and white situation and only revealing the confession is prohibited from what I can see.
Can. 983 §1. The sacramental seal is inviolable; therefore it is absolutely forbidden for a confessor to betray in any way a penitent in words or in any manner and for any reason.
§2. The interpreter, if there is one, and all others who in any way have knowledge of sins from confession are also obliged to observe secrecy.
Can. 1388 §1. A confessor who directly violates the sacramental seal incurs a latae sententiae excommunication reserved to the Apostolic See; one who does so only indirectly is to be punished according to the gravity of the delict.
§2. An interpreter and the others mentioned in ⇒ can. 983, §2 who violate the secret are to be punished with a just penalty, not excluding excommunication.
Sources: vatican.va/archive/ENG1104/_P3G.HTM vatican.va/archive/ENG1104/_P54.HTM