using exact comparisons == for floats is usually a bad idea, prefer to use velocity.is_equal_approx(Vector2.ZERO). Side note Input.get_vector is already normalized, by normalizing it again you break controller support.
it might work in this case but I think we would need to see more of your script.
Make sure to paste your scripts instead of screen shots