There might be a delay between calling ent_create and executing its action. Wait for a few frames before activating gravity or ent_create all segments in advance and then activate them all in the same frame.