entityQuery condition for users without a role
Your original code is correct. The problem is condition of 'not in'. It doesn't give result of users who has no roles. If you give roles to each user you are good to go. 

More reading

You can get deeper understanding from class file 
   https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Database%21Query%21Condition.php/class/Condition/8.2.x

Also there is a Drupal 7 API documentation about conditional-clauses
https://www.drupal.org/docs/7/api/database-api/dynamic-queries/conditional-clauses