I had much the same problem, but when I attempted to backup and then restore the course, it worked flawlessly. The problem is that I have not found out what caused the problem to begin with. If I'd received error messages, I could have tracked the problem, but I did not receive any errors. The newly restored course no longer had the offending grades [pending deletion].
I don't want to restore over a course every time I delete a quiz, so any additional information about how to track down the root cause of this problem would be appreciated.