orConditionGroup() - unexpected result $query = \Drupal::entityQuery('node');

$group = $query-&gt;orConditionGroup()
 -&gt;condition('field_ref1_user.entity:user.uid', $user-&gt;id()) 
 -&gt;condition('field_ref2_user.entity:user.uid', $user-&gt;id());

$ids = $query
 -&gt;condition('status', 1)
 -&gt;condition('type', 'mynodetype')
 -&gt;condition($group)         
 -&gt;execute();


The first condition in $group met 3 nodes and the second condition met 1 additional node (different from 3 nodes of condition 1) so since it is OR condition I expect to get 4 node IDs but I receive only 3 node IDs that met the first $group condition.

If I switch the conditions within the $group, I get 1 node ID, that met the first condition. It's seems that the second condition in the group is ignored.

What is wrong with my code?
Is there a way to see the query that actually executed?

Edit
I have activated WebProfiler to see the actual query.  

WHERE (node_field_data.status = '1') AND (node_field_data.type = 'mynodetype') AND ((users_field_data.uid = '11') or (users_field_data.uid = '11'))


These are 2 different user reference fields but for both of them the query checks users_field_data.uid = '11'
I can't see any issues with your code, and this might be a dumb answer, but a while back I was having trouble with chaining together entity query conditions. I got everything working by splitting it into individual statements. It didn't seem logical that that should make a difference, but it did. (Though, I'm sure it's possible I had some other logical problem that was the actual issue, and separating into statements was just incidental.) But maybe try...

$group = $query-&gt;orConditionGroup();
$group-&gt;condition('field_ref1_user.entity:user.uid', $user-&gt;id());
$group-&gt;condition('field_ref2_user.entity:user.uid', $user-&gt;id());

$query-&gt;condition('status', 1);
$query-&gt;condition('type', 'mynodetype');
$query-&gt;condition($group);         
$ids = $query-&gt;execute();