As of SERVER-40089, the distinct key may be used to create a projection spec in the resulting canonical query. However, if the key contains an embedded null byte then we'll create an invalid BSON since BSON keys are null-terminated (while values are not, they are allowed to contain null bytes).