Bottom line, in NextCloud you shouldn't be looking at the files from the command line, ever. Not NextCloud files anyway. Permissions are meant to be handled by the app and it's database, not by the filesystem.
Well mostly. Nextcloud needs the files to have the right system permissions.
But user permissions have nothing to do with system permissions.
Also, for a few specific instances, I do quite a bit with Nextcloud files on the command line. But that is a very specific use case, and also has nothing to do with group or share permissions.