Some students don't have grades for an exam

I have a timed exam that contains a randomized content block with single-choice problems in it.
Most of the students have grades, but some students don’t, I went to the unit and viewed it under their username and they answered multiple problems correctly (many 1/1 points) but in their progress tab it showed 0 points (all 0/1).
I faced this situation before, if I recompute grades for this course, these students will have their grades updated. But I want to know why this happened and how to reproduce, debug and fix it.