I do not know the answer, but I'd like to make a guess.
When you run sum(1, 2, 3, na.omit = TRUE), it tries to add 1, 2, 3 and na.omit. Among these, the last one is assigned the logical value TRUE, which is coerced into 1, because of this:
Logical true values are regarded as one, false values as zero. For historical reasons, NULL is accepted and treated as if it were integer(0) .
It is nothing specific to na.omit, you can try anything, for example avada_kevadra = 4 and it'll return 10.
> sum(harry = 1, ron = 2, hermione = 3, avada_kevadra = 4)
[1] 10
Note that none of harry, ron, hermione or avada_kevadra is defined in the global environment.