If you are talking about the Godot icon as a "gate", then the reason it isn't working is because it is rotating and thus has no linear_velocity.
But the best way to do this is this:
set_mode(RigidBody2D.MODE_STATIC)
When you want to stop it.
and then do:
set_mode(RigidBody2D.MODE_RIGID)
when you want it to move again.