Change autocomplete results based users selected checkbox
MYMODULE/src/EntityAutoCompleteMatcher.php:

class EntityAutocompleteMatcher extends \Drupal\Core\Entity\EntityAutocompleteMatcher {

  /**
   * Gets matched labels based on a given search string.
   */
  public function getMatches($target_type, $selection_handler, $selection_settings, $string = '') {

    $matches = [];

    $options = [
      'target_type'      =&gt; $target_type,
      'handler'          =&gt; $selection_handler,
      'handler_settings' =&gt; $selection_settings,
    ];

    $handler = $this-&gt;selectionManager-&gt;getInstance($options);

    if (isset($string)) {
      // Get an array of matching entities.
      $match_operator = !empty($selection_settings['match_operator']) ? $selection_settings['match_operator'] : 'CONTAINS';
      $entity_labels = $handler-&gt;getReferenceableEntities($string, $match_operator, 10);

      // Loop through the entities and convert them into autocomplete output.
      foreach ($entity_labels as $values) {
        foreach ($values as $entity_id =&gt; $label) {

          $entity = \Drupal::entityTypeManager()-&gt;getStorage($target_type)-&gt;load($entity_id);
          $entity = \Drupal::entityManager()-&gt;getTranslationFromContext($entity);

          // Only return bundle types we want.
          if ($entity-&gt;bundle() == 'page') {
            $matches[] = ['value' =&gt; $label, 'label' =&gt; $label];
          }
        }
      }
    }

    return $matches;
  }

}


More work would need to be done, but this shows where we can control the returned list of referenced entities.

See:

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityAutocompleteMatcher.php/8.8.x