CameraOffset script has Massive diffrence when shiftlock is enabled

As the title explains my camera system is supposed to work fine but when its in shiftlock it just completely does insane movement

Script:

local rus = game:GetService("RunService")
local character = game.Players.LocalPlayer.Character
local hrp = character.HumanoidRootPart
local Torso = character.Torso
local camera = workspace.CurrentCamera
local humanoid = character.Humanoid
rus:BindToRenderStep("CameraOffset",1,function(dt)



	local offset= hrp.CFrame:ToObjectSpace(Torso.CFrame).Position

	humanoid.CameraOffset = humanoid.CameraOffset:Lerp(offset,dt*8)




end)

Example Video:

Just disable shiftlock. Is there a reason you need it?

The shiftlock is a core feature in my game removing shiftlock would be like removing jumping for a parkour game

Fixed this by scripting custom shiftlock