If you haven’t watched Gravity Falls, do not read this comment.
No, Stan and Ford swapped clothes so Bill thought Stan was Ford and vise versa. They then used the memory gun to trap Bill and therefore delete him from existence. (Although he has made a deal with a “cosmic axolotl” and may come back)