Physics mesh separating from visual mesh!?

I have this code that aligns cubes together depending on the side you click on, and it works pretty well but occasionally the physics mesh get separated from the visual mesh. Has anyone else ran into this problem, is it a bug in blender?
Here’s a screen shot of the separation:



EDIT: Here’s the blend: alignV4Test.blend (533 KB)

Can you attach a blend or script?

I updated the first post with the blend, if you try to stack 3 cubes you can recreate the problem.

I’ve narrowed the problem down to restoring the dynamics of a child object. I should be able to make a work around. So thanks to anyone to took a look at the file.

Do you guy’s think I should report this to the bug tracker?