Getting permission error when taking backup of mongodb 8.0.0 sharded cluster

When trying to backup using mongodump from secondary/primary of one of shard, I’m getting this Unauthorized permission error

Failed: error creating intents to dump: error creating intents for database kubedb-system: error getting collections for database kubedb-system: (Unauthorized) You are connecting to a sharded cluster improperly by connecting directly to a shard. Please connect to the cluster via a router (mongos).

Here kubedb-system is a database created by user. I can take backup by connecting to mongos. But i need to take backup of each shard individually from every shards secondary instance.

I didn’t get this error on MongoDB version 7.x.