When we have only one shard key index, we cannot hide it.
This behaviour is implemented checking the name of the index:
assert.commandFailed(coll.hideIndex("skey_1")); // OK
But we can still hide the index using the key pattern (not correct):
assert.commandFailed(coll.hideIndex({skey: 1})); // KO
And we will jump the checks and hide it.
To be able to solve this issue we must get the indexName from the cmrIndex->idx and not from the local variable indexName in coll_mod.cpp.