Camera bugging out during animation (HELP!)

I made an animation for a game and I am playing the animation on the character. I set the Camera’s CameraType to scriptable, but it bugs out during the animation. At the end, I fall through the map.

NO ERRORS ARE IN THE OUTPUT!

Footage:

Script I Wrote:

local spawner = workspace.HelicopterSpawn.HumanoidRootPart
local player = game:GetService("Players").LocalPlayer
local char = player.Character
local root = char:WaitForChild("HumanoidRootPart")
local animation = script:WaitForChild("Cutscene")
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable

root.Anchored = true
root.CFrame = spawner.CFrame

local anim = char:FindFirstChild("Humanoid"):LoadAnimation(animation)
anim:Play()

anim.Stopped:Connect(function()
	workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
	root.CFrame = workspace.SpawnGoal.CFrame
	root.Anchored = false
end)

game:GetService("RunService").RenderStepped:Connect(function()
	if workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable then
		workspace.CurrentCamera.CFrame = char:FindFirstChild("Head").CFrame
	end
end)

Any way to fix this?