Give 2 users folder permissions only works periodically

I have a weird issue with folder permissions on my ubuntu server.

I have 2 users which need access to nginx logs, www-data (nginx) and dd-agent (datadog, a logging service).

I created a group logusers and added both users to that group, then I changed permissions as follows:

sudo chown -R dd-agent:logusers /var/log/nginx/

I can see the following for ls -l:

drwxr-xr-x 2 dd-agent logusers 4096 May 29 06:25 nginx

Then I check both the status of the dd-service and nginx-service, and both are fine, but after a couple of hours, datadog reports a permission denied error for opening a file inside /var/log/nginx/.

How can I make sure both users have proper access? Why does this change over time?

–Edit: Restarting the datadog-agent service and checking its status again shows no permission errors. This is weird.