I'm getting this issue, today, as well. Did you ever find out what was causing it? In my case, I noticed that the "Student" had actually been mistakenly assigned a teacher role, and then it was switched after they did the exam! It's still strange, though, that the exam attempt would disappear.
If the student had teacher permissions when they 'attempted' the quiz, then I have really bad news for you. Moodle treated that just as a teacher previewing the quiz, and not as a real attempt. And previews are not kept. So I am afraid the data is gone.
The fact that an innocent mis-configuration of roles like this can cause serious data-loss is worrying, but no-one has ever found time to deal with MDL-54875.
The fact that an innocent mis-configuration of roles like this can cause serious data-loss is worrying, but no-one has ever found time to deal with MDL-54875.