i have the same problem. the animals also die on beds. i think the problem is that since beds and carpet arent full blocks but still have a full hitbox, the game thinks that the entity is inside the block which causes the game to suffocate the mob.
to make it more understandable, pigs, sheep, cows, dogs, cats, and their baby counterparts are only a block tall. the carpet has a full hitbox but is not a full block. same goes for beds. when the mob stands on the incomplete block, the game thinks that the mob is inside the block causing the mob to start suffocating.
i have the same problem. the animals also die on beds.
i think the problem is that since beds and carpet arent full blocks but still have a full hitbox, the game thinks that the entity is inside the block which causes the game to suffocate the mob.
to make it more understandable, pigs, sheep, cows, dogs, cats, and their baby counterparts are only a block tall. the carpet has a full hitbox but is not a full block. same goes for beds. when the mob stands on the incomplete block, the game thinks that the mob is inside the block causing the mob to start suffocating.
i hope i helped at least a little.