Replacing causes case conversion

See here:

and I still can't reproduce it