The findAndModify command tries to commit even after there is an error on one of the shards.
From the BF Comments:
Our theory is that the there is a failure after the findAndModify is converted into a transaction here: https://github.com/mongodb/mongo/blob/master/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp#L323. The recursive invocation of _runCommand only throws an error if response.status is ok or if the response.data has an error that is is in
{NeedRetargettingError, SnapshotError, ErrorCodes::StaleDbVersion}. So the command will try to commit if it's not one of these.