Yea so I have some bad news for you, your "magic" bug isn't so much limited to magic only, other variables are also randomly affected on reloading a save.
Like I reloaded a save a few times to see the other reactions and on one it reset my background, on another my height (I found this one out by digging around in my local session storage of the webpage) and so on.
Also this seems to be an unfamiliar environment (by that I mean I have done a few too many misclicks) for an IF, usually its either twine or Cscript, what are you making your book in? Good luck with debugging though.