That would be "Das Baby ist ein Apfel", not "einen". But I did the same as you anyway!
Sometimes a baby is referred to as an "it" in informal speech because because "baby" is a gender-neutral term. Since a baby is not old enough to express a personality very well, a casual bystander may refer to the baby as an "it" if the bystander doesn't know the baby's gender. However, no one refers to a person older than a toddler as an "it". Instead, a person with an unknown gender would be referred to as "he" in formal writing [since the person referred to is a member of mankind], "he/she" in modern publications [that don't want to suggest that the person is not female], or "they" in informal speech [where the speaker has the same concerns as modern publications but only wants to utter a single syllable].
They should not leave a baby alone to eat an apple. Since it has no teeth to chew the apple pieces it could be dangerous for the baby. Unless the baby cant bite on the apple. But some babies with their newly grown tiny cute teeth can; and that is dangerous!!!
The term "baby" is quite broad. Infants around 1yo sure have teeth, but may still count as babies.