I have an annoying problem with a script of mine. When any GUI of the script is closed, the taskbar often shows up (it is hidden normally). This does always happen until the script is reloaded. Then it is decided (by an unknown factor) whether everything works as normal or whether the problem appears again (until the script is reloaded again). It does not matter what is displayed in the GUI and how it is closed.
Furthermore sometimes the taskbar appears when this exact script is reloaded via
Unfortunately I could not create an minimal working example. The code is a few hundred lines and every minimal example I create does not show the aforementioned problems.
Does anybody have an idea what might be causing those problems?