By default, any queries using
Query perform special processing of
Missing values. The installed up-value will have no effect while that special processing is in place. We can use
MissingBehavior -> None to disable the special treatment and to allow our up-value to take effect:
d[All, 1 + # &, MissingBehavior -> None]
(* <|1 -> Missing, 2 -> 2., 3 -> 5.|> *)
In general, I would discourage adding an up-value to a protected system symbol like
Missing. The present observed difficulty is an example of why -- many components make assumptions about the exact behaviour of built-in symbols. At the very least, I would recommend using
Internal`InheritedBlock) to keep the redefinition somewhat localized.
Incidentally, the dataset machinery that performs the special missing processing happens to ignore this advice. It temporarily redefines the behaviour of
Block). That is why
Missing appears to behave erratically in this context.