If the screen didn't display anything then the contacts had a bad connection, that's what erased your saves. You reinserted the game which cleaned the contacts just enough to get it working again, but it's not going to be reliable. Clean your cartridges, clean your cart slots. Same for memory cards for systems that have them.