If this is caused by the same issue which I'm already aware of, then there's a good chance that replay can be recovered.
However, the last two people ran away from me (preventing me from fixing the issue) after I told them how to get the replay.
So I'm going to withhold that information from you for a few more minutes.
First, please post the log of your game which failed to save properly to https://paste.replaymod.com and link to it.
You can find the logs in the "logs" folder inside your .minecraft folder. If it's the last time you ran the game, it'll be the "latest.log", otherwise it'll be one of the other ones (you should be able to identify which one by looking at the modification time stamps).