[Autocomplete] Does not work when Repository does not extend EntityRepository
When your Entities repository does not extend \Doctrine\ORM\EntityRepository, every request to the EntityAutocompleteController will result in a type error.
This is because the repository is accessed through a wrapper around the Doctrine registry (\Symfony\UX\Autocomplete\Doctrine\DoctrineRegistryWrapper), which instead of ObjectRepository typehints \Doctrine\ORM\EntityRepository.
The only case when methods of EntityRepository that are not in ObjectRepository are used, are however in https://github.com/symfony/ux/blob/67993da292436da91d866c7ef232655ab1975fb9/src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php#L56, only when a FormType does not declare a 'query_builder' – only then, $repository->createQueryBuilder('entity'); is being used. It should be possible to use Entity Repositories that don't extend the Doctrine implementation as long as you provide a 'query_builder'.
The normal EntityType allows using repositories that don't descent from Doctrine's default implementation.