An 18-month-old "miracle baby" was discovered alive in a hospital morgue after a doctor had incorrectly pronounced him dead.