Nextcloud version: 22.2.3 Operating system and version: Debian 11 Apache or nginx version: nginx 1.18 PHP version: PHP 8.0
The issue you are facing:
When trying to share files with other groups, only groups the current user is part of are shown in the autocomplete bar. It doesn’t matter if the group you’re trying to find is an LDAP or a locally created group - you can’t find it in the share dialog when you’re not part of it and it doesn’t seem possible to fix this behaviour.
Steps to replicate it:
Create multiple system groups in nextcloud.
Assign the current user to just one of these groups.
Try to share a file or folder with a group that’s the user is not part of.