I had similar problems. Certain key combinations in vscode would cause the cursor to delete or corrupt large sections of my code and delete the undo history. After losing hours of work a few times, I went back to Vim. I really like the process of customizing my editors and having them work the same on all machines, even remote servers. (Vim for coding, and Emacs/Evil for Org Mode.)