If you use for example redis bitnami helm chart with Replication, FLUSHDB is not possible. To fix this you can make follow this guide.
Adjust your wp-config.php in this style:
define('WP_REDIS_CLIENT', 'phpredis');
define('WP_REDIS_HOST', 'redis');
define(