Windows is, as a rule of thumb, extremely buggy in Dosbox. That’s not even a particular issue with Magic Dosbox.
To prevent data loss, make sure to always shut down Windows properly (Start button – Shut down Windows). Also, even when it says “It’s now safe to turn off your computer”, it actually may not. Wait at least 10 seconds longer (that’S what
I do at least), before you close Magic Dosbox.