3d Character gets stuck in ceiling

Godot Version

Version 4.2.2

Question

does someone know why the physics can detect that the player isnt allowed to crouch at the edges of an object, but when i try to stand up underneath it, it just lets me do it? I tried a raycast,shapecast and now an area 3d, I assume that the following lines are to blame since the breakpoint always lets the action pass even when it shouldnt.
heres the code :

elif $CollisionCheckArea3D.has_overlapping_bodies() ==false:
			MovementStateChange("stand")
			Speed = WalkSpeed