There used to be a case where a write command swallowed the original error code and replaced it with OperationFailed, but we believe that has been fixed in
SERVER-33542. This ticket has been left open to track the work to remove the special case for it here.
SERVER-31730, there are commands that swallow plan executor errors (like InterruptedDueToReplStateChange) and instead return ErrorCodes::OperationFailed. This interferes with mongos retry logic and the retry logic in the jscore and concurrency continuous stepdown suites.
Grepping for "executor error" turns up a few more places where this could be an issue, since it seems like this logic has been copied across a few commands.