points of sketch are moved slightly

i have a sketch that is not made correctly. sometimes it works and the points are put at the right position. but very often the points are moved a little bit and i know that my code is correct.

can someone tell me why it's like this? is it a bug in solidworks?

thanks, dave

SolidworksApi macros