As part of
SERVER-35689, Replica set targeting was made async (but with blocking in the ARS). But when we block on the returned future, we do so via an opctx which isn't marked uninterruptible (https://github.com/mongodb/mongo/commit/a276b7b1d0cc1d8d1e35bc0a222d2b2cce64bf43#diff-00d70c3e68a7ef394d6fccee5532e7e7R300) this means that opctx killing, or timing out, during scheduling leaves dangling references to the ARS and the baton in the ARS destructor. This in turn causes the invariant inside the baton to trigger.
I believe that the fix for now should involve making that an uninterruptible wait