A two-year-old boy has died after being left in a car outside a daycare for several hours because staff forgot he was there.