Ahhhh that makes total sense! I am also in Godot! I'm wondering how you're doing the rotation on the y axis. Are you doing something like rotation.y = get_viewport().get_mouse_position().x?
I didn't know if you could try something like this:
func _input(event):
if event is InputEventMouseMotion:
rotate_y(-event.relative.x * mouse_sensitivity)
camera.rotate_x(-event.relative.y * mouse_sensitivity)
That's if you are using a mouse_sensitivity variable or something at the top. I'm not sure if you are, might be nice <3 Not sure if this helps at all or if this is how you are already doing it! I never designed a first-person camera view like this yet in Godot (only in Unity)!