Not entirely sure with rnddom comment, it is widely recommended that anything that has to do with player movement and physics, needs to be in the physic_process to properly function.
I think this might be helpful
https://docs.godotengine.org/en/stable/tutorials/rendering/jitter_stutter.html