We have now seen this behavior across four students.
They get re-enrolled in a course and they are logging in at the same time that
enrol\database\cli\sync.php is run
Would like to avoid shutting off logins for a short period while the sync runs
The side affect of them being re-enrolled is that all the grades for the courses they are re-enrolled in that were entered prior to the re-enrollment are deleted.
This is Moodle 3.1