In the two situations above, students will still receive the green bar, but in it there is a message saying that their score on the question was not recorded.
The scores shown on the homework set page or the Grades page are taken directly from the database. I've never had a situation where those grades mysteriously disappeared. The only situation where I could see that happening was if an instructor unassigned, then re-assigned a homework set.
Students can check one of the two mentioned pages for the assignment, and also make sure that they are logged in as the correct user (as shown in the top right corner). If this is changing, then something else is going on.
One other thought: if you are using an external authentication system, it might be possible that it has created more than one account for a student based on how they logged in, but you should immediately notice this when you look at the class list.