The second commit in #13439 made the TODO in the first commit impossible to solve.
The meaning of fNewBlock changed from “This is the first time we process this block” to “We are about to write the new valid block”.
So whenever fNewBlock is true, the block was valid. And whenever the fNewBlock is false, the block is either valid or invalid. If it was valid and not new, we know it is a "duplicate". In all other cases, the BIP22ValidationResult() will return the reason why it is invalid.