You are supposed to die, the upgrades are stacked, and you don’t lose your upgrades. It’s completely fine and normal; it was designed that way. Also, as you progress in the game, you become more confident against the boss, because it’s not a great idea to fight him from a long distance!