Rigidbody applied in script animation

I created a script in which it creates a sphere every 10 frames, and adds a rigidbody constraint to each one.
When I play the animation, everything behaves as expected. Each sphere is created, falls due to gravity and repeats.
When it is set to render each frame, the first sphere is created, with the rigidbody constraint, but each sphere after that does not have the rigidbody constraint applied - yet it works when playing the animation.

Any ideas why this is happening? A setting I need to change?