Head point to mouse isnt always pointing to mouse

video:

code:

local neck = char.Torso.Neck
local headPos = char.Head.CFrame.p
local torsoLookVector = char.Torso.CFrame.lookVector
			
local point = mousePos
local dist = (char.Head.CFrame.p - point).magnitude
local diff = char.Head.CFrame.Y - point.Y
			
neck.C0 = neck.C0:lerp(neckOriginC0 * CFrame.Angles((math.atan(diff / dist) * 0.6), 0, (((headPos-point).Unit):Cross(torsoLookVector)).Y * 0), 0.5 / 2)

it is meant to always point in the direction of the mouse (like the gun in the video) but at a certain point it just doesnt
is this any way to fix this?

fixed it by doing

neck.C0 = neck.C0:lerp(neckOriginC0 * CFrame.Angles(math.asin((-mousePos - -rootPart.CFrame.p).unit.y), 0, 0), 0.5 / 2)