From peanut allergies to hormone replacement therapy, doctors have reversed their previous guidance. Why do researchers get things wrong so often?