The changes from
SERVER-51070 removed a special-cased logic on MongoS which was automatically retrying writes against the config server in exchange for them going through the regular write path.
The original logic was parsing the internal requests and bubbling up the embedded errors, which were automatically retried, but this was only correct if the writes were actually idempotent (which is the case of our tests, but not safe for general writes to the config server).
The regular write path uses a RetryPolicy::kNoRetry policy, which means NotPrimary errors for example will be passed directly back to the client. It should be the client (in this case the tests), which perform retries rather than MongoS doing it unconditionally.