Switches turning off and on at random

I'm having a problem where whenever I load a save, switches in a certain range get turned off and on at total random.
I am not using these switches in any way before loading a save file, and in most cases I hadn't even used them at all in-game before loading that save.

What could be causing this? Does the RPGmaker system use certain switches in its code that should be deemed "untouchable"? Do certain scripts? I really have no idea why this happens.

Inside the spoiler are screenshots of the affected switches in two different cases, ignore the dumb switch names. I should mention that all of the switches in the first image were off, while all the switches in the second image were on.

Spoiler
HM6eo6s.png

3HmWqQI.png
Most likely it's the script that causes such a mess. The default RM will never alter the switches on its own.
Most likely it's the script that causes such a mess. The default RM will never alter the switches on its own.

Sifting through the scripts I have, there doesn't seem to be any instances where any switches are used.... I'll try turning off the various scripts I have one at a time to see what happens
Press CTRL-Shift-F in the script editor window and look for the switch numbers in question. If a script is at fault, the respective numbers have to come up somewhere.
Press CTRL-Shift-F in the script editor window and look for the switch numbers in question. If a script is at fault, the respective numbers have to come up somewhere.

I tried this method at first but it returned nothing. Disabling the scripts one by one I figured out it was because of theleech's global save script, that doesn't seem to call those switches anywhere in the actual code. I'll just get rid of the script and work around the loss.
that doesn't seem to call those switches anywhere in the actual code
Yeah, it does.

You should NEVER add a script to your game without reading the instructions and configuring it. Working on the assumption that you actually had a reason to add the script in the first place, this is the very first thing you should have done, and it should only be touching the switches and variables you told it to. Since the switches in your screenshot are not the ones defined by default, it appears you did at least try to configure it, then forgot you'd done it.

Code:
# ---INSTRUCTIONS---
# Put the numbers of the variables to save and the switches to save in the
# VARIABLES_TO_SAVE array, and the SWITCHES_TO_SAVE array.
# If you want to automatically load/update the globally saved data, set the
# SAVE_ON_SAVE LOAD_ON_LOAD and LOAD_ON_NEW flags to true accordingly.

# An array that contains a list of variables to save in the global save file
# Enter a list of variables, by number, seperated by commas.
# You can use '..' to include all variables between two numbers
# Example: 15..42
# Will include all variables or switches between 15 and 42 (inclusive)
# Leave blank to save none of that type
VARIABLES_TO_SAVE = [25..30]
# Same as above, but for switches
SWITCHES_TO_SAVE = [25..27, 29, 101]

Original thread: https://forums.rpgmakerweb.com/threads/switches-turning-off-and-on-at-random.105280/