How did my custom code move itself?

This is the one that is behaving as one would expect:

This is one behaving unexpectedly:

I’m guessing this means made on the site. They aren’t linked currently to a github repository.