This is a major bug. Make sure you're playing an updated version of the game. (At least 6.1.4)
If you're already playing an updated version, then please check the files in the game's folder. If you find an "Error Log.txt" file, please copy/paste its content here so I can determine the problem.
In the meantime, try downloading this file: https://files.catbox.moe/6towva.reg
While you're not playing the game, double-click this file. Click "Yes" if asked.
Windows will say, "The keys and values ..... have been successfully added to the registry." Click "OK".
When that's done, play the game again and let me know if the problem still happens.