The teardown of the testAddShard test case of jstests/sharding/store_historical_placement_data.js removes a technical shard that is added in the setup for the specific purposes of the test case.
Suppose the primary node of the config server steps down right after removing the config.shards document of the shard but before responding with the completed state, the test retries the command against the new primary node, which would not find the removed shard in its ShardRegistry. This would cause the second attempt to fail with ShardNotFound.
The goal of this ticket is to hard the shard removal to consider the scenario above.