The check for whether a shard is already participating in a migration as either donor or recipient is racy and may allow both to happen at the same time for the same collection.
This should never be allowed to happen because it may lead to a state of the cached shard metadata which is consistent as far as the shard version is concerned, but is missing the received chunk.