Screen glitches on 8x Game Boy shader I customized

I made an “gb-dmg-alt-8x.slangp” shader for use on a 4k display. It’s just gb-dmg-alt-7x.slangp with the scaling changed like so:

video_scale = "8.0"
SCALE = "1.0"
OUT_X = "6400.0"
OUT_Y = "3200.0"

My problem is I get some minor, but annoying, distortions around the border of the screen:

Now, this only happens if I use this as the core’s default shader and load it with content when running RetroArch, or when using the --set-shader switch, etc. If I load content first, then open the menu and load the exact same shader, it looks fine:

Any ideas? Something I need to edit in the preset?