A woman who tried to poison her two-year-old daughter with insulin was suffering from symptoms of a rare psychological disorder at the time of the offence, a court has been told.