I'm not sure why, I can say that sometimes using a sort of attachment code will mess up due to the fact that there is a gap between when the player's position is updated and when the sword's position is updated. Try putting proc_late(); at the top of the sword code, this will make it so that it is updated AFTER the player instead of before. It may help, it may not, it may help only a little.

Also, are you using ent_animate with anm_cycle to animate the player? Using that and then using my.frame = player.frame tends to mess up around the end of the player animation cycle because the last frame is blended to the first frame. You could either make a code that ent_animates the sword based on the player's animation speed --- ent_animate(me,"walk",player.anim_dist,anm_cycle); --- or you can use anm_add and just make sure that your animations cycle well on their own.

Also, also; instead of this:
Code:
my.scale_x = player.scale_x;
my.scale_y = player.scale_y;
my.scale_z = player.scale_z;


Use this, it's faster, speed is the issue with sync:
Code:
vec_set(my.scale_x,player.scale_x);


Do the same for the other vectors; use vec_set(my.x,player.x); and vec_set(my.pan,player.pan); check out vec_set in the manual.

It's most likely a problem that can be fixed using proc_late(); and vec_set.