ReshardingTxnCloner will return true from its until() lambda when the cancellation token isn't canceled. This means the remote donor shard returning a Cancellation or NotPrimary error causes the local recipient shard to halt cloning config.transactions records. The !cancelToken.isCanceled() condition should really be cancelToken.isCanceled() (see also ReshardingCollectionCloner for comparison).
This pattern with AsyncTry is fairly common throughout the resharding code. We should consider making a common utility to express this logic. The withAutomaticRetry() function added as part of
SERVER-51606 switched to a pattern that avoids checking the cancellation token in the until() lambda because the AsyncTry always checks the cancellation token on its own anyway.