I'd written a query based on the "simplified" version here. And my code looked like this.
$results = \Drupal::entityQuery('node') ->condition('type', 'mytype') ->condition('status', 1) ->condition('field_first.target_id', $anArrayOfNids) ->condition('field_seciond.target_id', array($anotherNid)) ->execute();
The code was working, I know it was. But now I'm getting an "SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens" SQL error.
I tried replacing it with just array(540) and got the proper result. Then I gave it array(546) and got the different, expected response, but as soon as I put [540,560] or array(540,560), I get that error, instead of what i used to get, which was the combined results.