This is probably problem with permissions on Linux level not Nextcloud per se.
U need to change default permissions of socket in /etc/redis/redis.conf
unixsocket /var/run/redis/redis-server.sock
unixsocketperm 700
With default permissions only redis user is allowed to connect to redis socket.
Change unixsocketperm
to:
unixsocketperm 770
Then restart redis:
systemctl restart redis-server
Add www-data to redis group
usermod -a -G redis www-data
Verify connection with this command
sudo -u www-data redis-cli -s /run/redis/redis-server.sock ping
PONG