Custom rig Motor6d movement breaking when teleported

Hi, I’m trying to make a turret compatible with a placement system. This means that I would need to use model:SetPrimaryPartCFrame() to move the turret to the position. However, after teleporting, the turret does not aim properly anymore (It does before when it is not teleported)
Vid Demo: Screen Recording 2021-08-27 at 10.21.47 AM.mov - Google Drive

Aim function code

local function aim(targetPart)
	local unit = (targetPart.CFrame.Position - script.Parent.Muzzle.CFrame.Position - Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))).Unit
	for i = 0.1,1,0.1 do
		wait()
		joint.C0 = joint.C0:Lerp(CFrame.new(Vector3.new(0,0,0),unit),i)
	end		

end

where targetPart is the enemy’s rootPart, and script.Parent.Muzzle is the Muzzle of the turret.
Anyone knows why the aim is broken after teleporting? Thanks for reading