During testing today I found a bug when attempting to delete a user using the user_delete_user method in /user/lib.php.
The errors related to the enrollib.php function user_delete();
The first issue appears to be just that $DB->get_records_recordset should be $DB->get_recordset_sql.
Second the names param :meta should probably be :name
The third problem (as far as I researched) is that ue.courseid isn't a valid field?
Let me know if there is more I can help with.