A woman with mental health issues was jailed for 74 days despite a court order for her to be transfered to a health facility.