I would like to know why the code moves only between 412 and 612
It doesn't. It only does something when the joystick value is below 412 or above 612. The reading from the joystick when it is not being held should be approximately, so the code requires that the stick be moved a noticeable amount, before it starts moving the servo.