When I start the project the cylinder starts rotating left on its own without pressing the left button on the keyboard. This continues until I press the left key then the left and right movements start working as expected. See the code snippet below. I am using Godot 4.1.3.
Edit: There was apparently a small input coming from one of the other joysticks connected to my computer. Once I unplugged that the problem went away.
func _process(delta: float) -> void:
if Input.is_action_pressed("ui_left"):
rotate_z(delta)
if Input.is_action_pressed("ui_right"):
rotate_z(-delta)