What is the desired effect and what is actually happening? A video would be helpful.
Assuming the CFrame math is correct, my guess is that the problem lies with :SetPrimaryPartCFrame(). This function is known to act in undesired ways. This can be fixed by setting the CFrame of the PrimaryPart itself instead of using :SetPrimaryPartCFrame.