Can I create non-default EntityReferenceSelection? I have the following EntityReferenceSelection plugin:
/**
 * Provides an entity reference selection for my_entity.
 *
 * @EntityReferenceSelection(
 *   id = &quot;extra:my_entity&quot;,
 *   label = &quot;...&quot;,
 *   entity_types = {
 *     &quot;my_entity&quot;
 *   },
 *   group = &quot;extra&quot;,
 *   weight = 1
 * )
 */
class MyEntityExtraSelection extends DefaultSelection {

  protected function getAllowedIds() {
    return [...];
  }

  protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
    $query = parent::buildEntityQuery($match, $match_operator);
    $query-&gt;condition('id', $this-&gt;getAllowedIds(), 'IN');
    return $query;
  }

  public function validateReferenceableNewEntities(array $entities) {
    $entities = parent::validateReferenceableNewEntities($entities);
    $allowed = $this-&gt;getAllowedIds();
    return array_filter($entities, function ($entity) {
      return in_array($entity-&gt;id(), $allowed);
    });
  }

}

I'd like to call it extra:my_entity because I don't want this filtering to occur by default, every time I use it, only when I refer to it using the 'handler' =&gt; 'extra' setting explicitely.
But the core plugin manager gives these errors:
Warning: uasort() expects parameter 1 to be array, null given in Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager-&gt;getPluginId() (line 65 of core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php).
Warning: end() expects parameter 1 to be array, null given in Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager-&gt;getPluginId() (line 66 of core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php).
Warning: key() expects parameter 1 to be array, null given in Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager-&gt;getPluginId() (line 67 of core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php).
Finally, after some investigation, two required items never documented:

unlike the core EntityReferenceSelection plugins that, for some reason, get away without it, you have to provide

deriver = &quot;Drupal\Core\Entity\Plugin\Derivative\DefaultSelectionDeriver&quot;

in the plugin annotation.

It might be completely unnecessary in your case but you have to make sure your custom entity type has an entity_key named label. If it doesn't, core will use PhpSelector instead of your selector, forcedly.