@kqcav I hope you made it working already, but I had the exact same issue after updating from NextCloud 4.23.4 to version 5 (which changes auth from ldap to oicd) and could solve it.
In my case almost every file and directory we use in our Nextcloud, where files from one Nextcloud user, that was sharing it with a group of users. We had to login this user with the new oicd "Login with Cloudron" and all files and directories were back again.