Doctors failed to diagnose a psychological syndrome that made a schoolgirl starve herself to death, an inquest heard.