Edit: penalty rehaul
If you lose all your HP and/or lives, you get the option to continue for 1 more life at the cost of 1,000 gems. Basically the second life/chance system when all lives are lost.
The penalty for doing so is that all XP and Gems are forfeit upon completion of said worlds. The penalty is a -50% reduction in XP and Gems earned. Items are excluded from the penalty.
The other option is default. Leave and receive nothing except the items that were already received. Considering that gems are already given up when leaving before completion, the penalty exists to counteract against and balance the second chance system like in other RPG games.
If the player is re-spawned with said chance, they get a 10 second enemy damage and trap immunity. If the player is disconnected within those 10 seconds, they received their 1,000 gems back.