Strange bug: Cubase deletes MIDI recording after stop.

I had a similar problem but using a controller that used key strokes. Somehow it was using backspace although I couldn’t see this in the config. I went into key commands and removed back space from delete and that sorted it. I wonder if you keyboard is triggering back space or delete keys. Maybe try another keyboard.