It's possible for the previous ShardRegistry reload to have failed (e.g., due to the majority snapshot not being available), and setFCV uses ShardRegistry::getAllShardIds(), which does not force a ShardRegistry reload.
We could band-aid this by adding a ShardRegistry reload before the ShardRegistry::getAllShardIds(), or we could force a reload inside getAllShardIds() (and maybe also ShardRegistry::getNumShards(), a similar function that has the same issue).