When in a submenu such as creating a new task or selecting an icon, pressing E to confirm that dialog instead closes ALL mission task windows and thus losing your in-progress work.
I don't know why this is the default, but this is a configurable key. E is bound by default as a secondary key to "Close All Windows" for this mod's key bindings. You can clear the config and it works as you would expect/want.