I had similar problem.
Problem is most likely in your code.
You did something unpredictable - out of logic
that breaks the script.
You can create a copy of backup files for that day
and trace where that happend. In your copy of backups
open saved xml files until you actually open it, Bad xml files
will delete themselves and you will discover what was last
version of your script that actually works, so you can continue
from that xml file, but be carefull to not reproduce same
error condition that lead to auto deletion.
In my case I used labels, and point label to impossible
point in the script by accident. And that was reason why
script deleted himself over and over again. When I corrected
it in recovered version, everything was back to normal
I had IF/ELSE condition and put label from IF part to point
to ELSE part, which is logically impossible, but you can create
such action. That scenario leads to case you described.
Maybe in your case its some other logically impossible action
that breaks your script. All in all bad coding practice or coding
error can lead to script auto deletion.