Hi wilricknl,
you’re messing things up because GetComponentRotation retrieves rotation in world space whereas SetRelativeRotation sets it in local space. Depending on whether you want to clamp your local or absolute pitch you’ll want to uniform your function calls – by either using GetRelativeRotation or SetWorldRotation.
hope that helps!
f