No, you're not getting an error because the script works exactly as intended - you just configured it wrong, that is why it doesn't do what you want.
I strongly suggest you follow the link to the tutorial "how to use a script" in my signature to learn how to handle scripts correctly.
The problem is that the script allows for dynamic changes in all layers. This can for example be used to create timed light overlays where different light overlay pictures are displayed based on a time variable, or animated ground because three or four different ground pictures are switched every few frames.
That is what the second number in ground1-1 is about - the first one is the map ID and the second one is a counter in case of several ground pictures to be switched for each other.
And that switch is done by a variable assigned inside the overlay script. Place a 1 inside that variable and picture ground1-1 will be used. Place a 4 inside the variable and picture ground1-4 will be used. And if the picture ground1-4 does not exist then nothing will be displayed.
Because you have not configured the variables correctly to a variable that you reserved exactly for this use, the variable is used twice now - by the script and for something else in some random event anywhere in your game. In that event you changed the variable to something other than 1, and the script now tries to display not ground1-1 but ground1-? with an unknown number at the second position, depending on what you have done with that variable.
That is one of the most important lessons on using scripts: they ALWAYS need to be configured. Not configuring one of the more complex scripts is a guarantee for failure. You always need to read the script for the instructions on how to configure it or you will always cause problems for yourself.
In fact, this very script was one of the examples I used in the tutorials exactly because it cannot be used without being configured. Unfortunately an old forum update has messed up the examples in the tutorial, but I hope you can still learn what to do.