Solution 1:

It sounds like something has got corrupted with your save file - to the extent that Minecraft no longer recognizes it. Your best solution is to restore from backup.

I'm taking it you don't have a backup, so the next best thing is to try and open it with another program, e.g. MCEdit, with which you can make some trivial edits and re-save, which may help restore your save file to an acceptable state. Note that MCEdit is not tied to your Minecraft save folder, you can manually load a map from any level.dat.

If this doesn't work (MCEdit won't open the file), you will have to sort things out manually. You'll need to look at the contents of your save file, and see where things could be going wrong. A good reference is the Java class that creates the save files. Good luck!

Solution 2:

I have had this happen to me and I found a easy way to recover the world

Step 1: find out the seed. if you don’t know the seed use NBTExplorer Download: https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-tools/1262665-nbtexplorer-nbt-editor-for-windows-and-mac

Step 2: make a new world with the same seed and go back to the main menu

Step 3: go to saves folder in .minecraft and copy the region folder from the old world to the new and replace all files

Step 4: load the world up and boom your world is back

Step 5: (only if you want your inventory) go back to the saves folder and copy the playerdata Folder

And enjoy