entityQuery condition for users without a role In Drupal 8 - Is there a way to do a 'NOT IN' in a user based entityQuery?

$uids = \Drupal::entityQuery('user')
      -&gt;condition('uid', 72)
      -&gt;condition('status', 1)
      -&gt;sort('created', 'ASC')
      -&gt;execute();


This query ^ yeilds results

$uids = \Drupal::entityQuery('user')
  -&gt;condition('uid', 72)
  -&gt;condition('roles', ['testing_user'], 'NOT IN')
  -&gt;condition('status', 1)
  -&gt;sort('created', 'ASC')
  -&gt;execute();


This query ^ does not. User 72 doesn't have the role 'testing_user'
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