BodyGyro shifts into the wrong orientation

So basically, I was making a Wall Climbing system in the steps of this post: Making a "Wall Climbing" System - #6 by Stealthied

It all went well so far until I was free falling before I pressed C to climb, which resulted in the body gyro shifting into the wrong orientation.
https://gyazo.com/70e259f59b66c3a7aee28c9b4d6d5e7e

One of the solutions I have tried consist of this:

Here is the code provided:

function OnClimb()
	local Origin, Direction = RootPart.Position, RootPart.CFrame.LookVector
	local RaycastResult = workspace:Raycast(Origin, Direction)

	if RaycastResult then
		Climbing = true

		Climbing_Animation:Play()
		Climbing_Animation:AdjustSpeed(0)

		BodyVelocity.Velocity = Vector3.new(RaycastResult.Position, RaycastResult.Position + RaycastResult.Normal)
		BodyGyro.CFrame = CFrame.lookAt(RootPart.Position, RaycastResult.Position)
		BodyVelocity.Parent = RootPart
		BodyGyro.Parent = RootPart

		Humanoid.PlatformStand = true
		Humanoid.AutoRotate = false

		repeat
			RunService.RenderStepped:Wait()

			if RootPart.Position.Y > RaycastResult.Instance.Size.Y + 3 then
				OffClimb()
			end
		until (not Climbing)
	end
end

this has been a problem for me too. A hacky solution I found was setting the CollisionGroup of the player (or the part) to something different than eachother.

I have attempted this but it appears that the BodyGyro’s problem remains.

	local Parameters = RaycastParams.new()
	Parameters.FilterDescendantsInstances = Blacklisted
	Parameters.FilterType = Enum.RaycastFilterType.Blacklist
	Parameters.CollisionGroup = "Climb"
	Parameters.IgnoreWater = true

Not exactly sure, have you tried Using the raycasts Normal instead of LookAt?

I have tried using RaycastResult.Normal along with CFrame.new() rather than CFrame.lookAt()