Rest API in Mautic 5 delivers empty result array but no error

There is a method in Entity\Lead.php that sets groups for this serializer.