It’s a blessing that the raccoon wasn’t rabid but seems odd that a baby in its bed would be able to invite an attack.
Baby smelled of food?
I had to kill a raccoon inside my home as it became aggressive when tried to shoo it out the door.
Raccoons can inflict a lot of damage with teeth and claws.
Smelling of yummy food and a live being that jumps suddenly and makes noise and wiggles? Wild animals tend to act “wild” when they are around babies of another species.