When it jumped out of the game while fighting in the middle of a mission, why doesn't it continue when I start again? And do I lose everything I earned when this happens?
What do you mean by "jumped out"? If you mean quit, then you've quit. It's just part of the deal. HOWEVER, if you mean that you got disconnected, you should resume from where you left off. I don't know if you have to reconnect within a certain span of time, but I wouldn't be surprised if there is one to prevent players from taking advantage of this in malicious ways.
The next part of your question is whether or not you keep all you earned. Simply put, yes, and no. Unlike other dungeon crawlers where you have to complete a level to leave with all you gathered, any crowns or alchemy materials found in the Clockworks are added to you inventory, and aren't taken out when you quit. HOWEVER, any heat earned will be lost, as this is the game's equivalent to EXP, and like most RPGs, you have to actually go all the way through to earn it. In Spiral Knights, this just means getting to the lift at the end of the level.
I hope that helped!