How do I reverse the worldposition of an attachment based on a door's position

I’m working on a swing door and I’m having trouble getting the proper position of the door’s open position, it works when the door’s rotated a certain way, the doors have two directions: ‘in’ & ‘out’. ‘Out’ is the direction towards the attachments. This direction functions correctly, but the ‘in’ direction is messed up.

Doors on this axis do not function correctly:

Doors on this axis do function correctly:

This is the code that opens the door:

local positionAttachment: Attachment = doorFrame[object.Name.."_Open"]
				
local inPosition: Vector3 = (positionAttachment.WorldPosition + Vector3.new(0, 0, (doorFrame.Close.WorldPosition.Z - positionAttachment.WorldPosition.Z) * 2))
local targetCFrame: CFrame = CFrame.lookAt(hinge.Position, direction == "out" and positionAttachment.WorldPosition or inPosition)
				
if skipAnimation then
   hinge.CFrame = targetCFrame
   return
end

TweenService:Create(hinge, TweenInfo.new(doorConfig.Door.Speed), {CFrame = targetCFrame}):Play()
doorFrame.OpenSound:Play()
doorFrame.CloseSound:Stop()

I know this was a little difficult to explain but I’m hoping I did a decent enough job, let me know if you need any other information. Thank you for any help.