Motors generate different motions with same data

That is weird.

Sync Write is just instruction where you are packing the data for TX. The following is briefly explaining how the sync instruction packs the data.

The key point in the image, the instruction is just do what you command.
But it seems that you code is well packing the goal position data when I briefly analyzed. So what I doubt, please check that Min / Max Position for your all DYNAMIXEL (ID 1 to 10 maybe?) and see if there is anything missing the value that should be set.