It is logical why it removes it, since switching to a cargo inventory, or creative mode inventory, means that your helmet isn't in your hotbar anymore.
If it isn't in your hotbar, you don't wear it.
Your helmet should stay on if you switched to a personal cargo inventory/creative mode and you had it on your hotbar before.