I was able to work around this by enabling the memberOf overlay. I made the group “cloud” as a groupOfUniqueNames and I add the users that I want to have access to Nextcloud to this group.
I modified the User Filter in Gitea to look something like this:
(&(objectClass=posixAccount)(memberOf=cn=cloud,ou=groups,dc=example,dc=com)(uid=%s))
Hope this helps someone. It would still be nice to do it without the memberOf overlay.