Did you ever get to the bottom of this?
I'm having exactly the same problem, I use the following code to create a grade in the gradebook.
$grade = new stdClass();
$grade->userid = 'userid';
$grade->rawgrade = '100';
It appears in the gradebook fine, but when a teacher goes to manually grade the assignment through the assignment link the grade doesn't appear.
As you have highlighted there is no submission for the grade in the 'assign_grades' table which I assume is the problem. I haven't yet found a method for adding the grade to both the gradebook and the assign_grades. You would assume the function 'assign_grade_item' would grade the assignment not just the gradebook.
Does anyone have any ideas?