The first option doesn't necessarily explain why or how the baby was stuck in the house. The second option makes it seem clear that something the baby did caused the baby to end up stuck. Also, gotton is definitely not correct.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.