We had a similar problem in 1.7 and 1.8 which occurred at the end of the session. Because the database had no enrollments for the student role after the session terminated, the entire unenrollment section of enrol_database_sync.php was skipped for that role.
I filed the bug as MDL-9937.
Enrolment
Exteral database unenrolment
This discussion has been locked so you can no longer reply to it.