Criteria for delcearing a user as REMNANT

Hi all, I with to undertand a bit more in depth when and how a users is detected as remnant.
Documentation: LDAP User Cleanup.

Right now i have 150 entries in oc_ldap_user_mapping table.
The command occ ldap:show-remnants is showing 139 remnants.
11 AD users are listed in the group ‘cloudusers’.

I wish to know which talbes the query is looking for, to find remnants.
In other words, where can I see inside the database that a user is marked as deleted?

Right now I have this problem:

sudo -u www-data php /var/www/nextcloud/occ user:delete myremnantuser
The specified user could not be deleted. Please check the logs.

This is the log:

{"reqId":"ISunCPGc+Qtokelrz2QK","remoteAddr":"","app":"user_ldap","message":"User myremnantuser is not marked as deleted, not cleaning up.","level":1,"time":"2017-10-11T10:09:08+00:00","method":"--","url":"--","user":"--","version":""}