In the direct_connection_auth_transition test, we create a collection and then run inserts on that collection while adding a shard and moving a collection to ensure that once the second shard is added, all inserts fail with Unauthorized errors due to being direct connections.
However, when run in allFeatureFlag variants, the initial create of the collection will create a tracked, unsharded collection. Due to SERVER-80135, this create may leave the collection with unknown filtering information. Any inserts done after the second shard is added will fail with Unauthorized, still, but any inserts done before this will fail with StaleConfig.
The test should ensure that the filtering information is known before beginning the insert thread so as not to encounter staleconfig errors.