Magic Jar states:
You can attempt to possess any humanoid within 100 feet of you that you can see ... The target must make a Charisma saving throw. On a failure, your soul moves into the target's body, and the target's soul becomes trapped in the container.
How does this apply to creatures that do not have a soul, such as undead and constructs, which are animated by magic? Does the spell fail to possess such a creature? Or does the animation magic get captured in the container as a substitute "soul"?