In addition to what the others said it also appears that your rectangle isn't perfectly centered in the shape layer to begin with. You might not even have run into this problem if it were. Also as a general tip for such scenarios it usually makes sense to put everything in separate shape layer groups, so even without parenting you can re-align stuff by manipulating the transform values of the group.
There are two solutions to this problem. Both involve parenting. If you start with the masked layer at the default Transform properties (Comp center and not scaled or rotated), you can copy and paste a vector path (mask or shape) to a motion path on your target layer. If you Parent the Target layer, the layer that will follow the path to the Masked or Shape layer before you move it, the layer following the path will always follow.
The second option, the one I use most often, is to select the path and then open Window/Nulls Follow Paths.jsx script and select Trace Path; a null will be created that follows the path no matter where you move or how you scale the layer with the path. You can then Shift + Parent the Target to the NulNullnd it will always follow the path, even if you animate the path or change it after creating the null. If yoNulln't want the Target to orient to the path you can tie the Position and of the Target to the Null with a simple pickwhip expression.
I've uploaded a project file that shows all three scenarios.
This is because when you copy the path it is relative to the path position inside the Shape Layer (shape layers acts as containers). Probably the easiest way to move the complete motion path once pasted over you target layer is to parent this layer to a null object and move the null object.
The path is relative to the path position after copying it.
But I feel, even after changing the position of the shape, and I copy the path again and paste into the target layer, it's the new path that should be copied not the former path.
The vector path is based on layer space. When you paste it into another layer, the coordinates are based on Comp space. It's as if you never moved the original layer with the mask. You cannot successfully copy a path and paste it to a motion path unless the original layer with the path has not been moved, rotated or scaled from it's default position.