Ragdolled Rig/Character Resetting When Touched By Another Player

So I was play testing my game as usual when I touched a ragdolled npc, for some reason the npc reset to not being ragdolled.

robloxapp-20241124-1341578.wmv (1.8 MB)

Heres the part of the code ragdolling the npc:

if model:FindFirstChild("Humanoid").Health < 1 then
					if yas == 0 then
						
						model.Humanoid.BreakJointsOnDeath = false
						model.Head.CanCollide = true
						model.LeftUpperArm.CanCollide = true
						model.RightUpperArm.CanCollide = true
						model.UpperTorso.CanCollide = true

						model.Humanoid.Died:Connect(function()
						    	for _, v in pairs(model:GetDescendants()) do
										if v:IsA("Motor6D") then
											local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
											a0.CFrame = v.C0
											a1.CFrame = v.C1
											a0.Parent = v.Part0
											a1.Parent = v.Part1
											local b = Instance.new("BallSocketConstraint")
											b.Attachment0 = a0
											b.Attachment1 = a1
											b.Parent = v.Part0

											v:Destroy()
										end
									end
									model.HumanoidRootPart.CanCollide = false
								end)
						
						game.Workspace.KillFX.Sound:Play()
						wait(0.05)
						game.Workspace.KillFX.Sound1:Play()
						
						
					--	model:Destroy()
					end
				end

If anyone has any answers, please reply, thanks!

Are you removing … Motor6D:Destroy() … all the motor6Ds before or after adding the Ball Socket Constraint joints? I also recommend having Explorer open while in game to see what happens to all the joints (contraints) when you touch this NPC!