cannot connect to valkey/redis

That older post mentions IORedis, which has an IPv6 gotcha:

That doesn’t sound the same as your own situation, though, since yours would have been failing all along. (Unless you did just modify that section of the code.)