query_builder's callback must return a Doctrine\ORM\QueryBuilder

calling a repository in a "query_builder" callback would result in an exception saying:
Expected argument of type "Doctrine\ORM\QueryBuilder", "array" given