Seems to be a genetal Dosbox issue, not Magic Dosbox related. Windows support, especially Wim98, is highly experimental, and can lead to all kinds of weird behaviour.
Win95 is more stable than win98 though, so you might want to try that, too.
MagicDosbox (C) 2014 – 2024