BodyAngularVelocity physic went weird for AI kart

I am currently rewriting steering for AI kart by tweaking their
BodyAngularVelocity mover (converting direction to angular velocity)

local function SmoothDamp(current, target, currentVelocity, smoothTime, maxSpeed, deltaTime)
	-- Based on Game Programming Gems 4 Chapter 1.10
	smoothTime = math.max(0.0001, smoothTime)
	local omega = 2 / smoothTime

	local x = omega * deltaTime
	local exp = 1 / (1 + x + 0.48 * x * x + 0.235 * x * x * x)
	local change = current - target
	local originalTo = target

	-- Clamp maximum speed
	local maxChange = maxSpeed * smoothTime
	change = math.clamp(change, -maxChange, maxChange)
	target = current - change

	local temp = (currentVelocity + omega * change) * deltaTime
	currentVelocity = (currentVelocity - omega * temp) * exp
	local output = target + (change + temp) * exp

	-- Prevent overshooting
	if (originalTo - current > 0) == (output > originalTo) then
		output = originalTo
		currentVelocity = (output - originalTo) / deltaTime
	end

	return output
end

local dir = 0
local y = 0
local turnSpeedDivider = 10

game:GetService("RunService").Heartbeat:Connect(function(dt)
	--if script.Parent.ok.Value then
		local vector = workspace.target.Position - script.Parent.Position
		local vector2 = script.Parent.CFrame.LookVector:Cross(vector)
		dir = vector2:Dot(script.Parent.CFrame.UpVector)
		local num = 0
		y = SmoothDamp(y, dir, num, 2.5 * dt, math.huge, dt)
		
		local finalAngularVelY = (y / turnSpeedDivider) * 1

		print(finalAngularVelY)

		script.Parent.BodyAngularVelocity.AngularVelocity = Vector3.new(0, finalAngularVelY, 0)
		
		-- For testing purpose
		script.Parent.BodyVelocity.Velocity = script.Parent.CFrame.LookVector * 50		
	--end
end)

It works normally when I tested in baseplate


But in opposite, BodyAngularVelocity physic became more sensitive and acted weirdly when tested in actual game

I don’t know what the root of this problem is, but if anyone could figure it out, I would appreciate it. And thank you.