Players die after server restart

I run a private server for some friends and I, however people seem to die when I close the server. Even after I do a proper save and use the server.stop command it forces players to respawn after the server closes. It treats them as an entirely new player and won’t let them respawn in their beds either. It’s getting really annoying and I don’t have a dedicated machine to keep it up all the time. Is there a way to stop this from happening? Or is this just a bug that hasn’t been resolved yet?