**Yes, your counterexample seems to be correct — there’s an error in Def C2.2.1 as printed.**  This issue is mentioned in the n-lab’s article on [dense sub-site](https://ncatlab.org/nlab/show/dense+sub-site) ([current revision permalink](https://ncatlab.org/nlab/revision/dense+sub-site/22)), which notes a very similar counterexample, and refers to a longer [nForum thread on the topic](https://nforum.ncatlab.org/discussion/7220/dense-subsite/) (mostly by Dexter Chua, Thomas Holder, and Mike Shulman).

An easy and clean fix is to restrict to *full* subcategories, as Zhen Lin suggests in comments.  But Johnstone clearly intends to cover the non-full case; straight after Def C2.2.1 he remarks:

> In practice, the Comparison Lemma is most often used for full subcategories, and many texts only define denseness in this case; however, the extra generality afforded by the definition we have given is occasionally useful — we shall see an instance of its use in 5.2.5 below.

The n-lab article offers another fix, modifying condition (ii) to say “for each $f : U \to V$ with $V \in \mathcal{D}$, there is some covering sieve on $U$ whose elements $g : W \to U$ all satisfy $fg \in \mathcal{D}$”.  But this condition seems much too strong: it will almost never hold (as noted by Dexter Chua in the nForum thread), even in the full case.  In particular, if I’m not mistaken, it won’t generally hold in the application in Johnston’s Lemma C5.2.5, showing that any étendue (i.e. a topos with a localic well-supported slice) has a site of definition with all maps monic.

So **the printed version is in error; but neither the restriction to full subcategories, nor the n-lab’s fix, seems to correspond to Johnstone’s intention, or suffice for his application in Lemma C5.2.5.**  It would be very nice to find a better fix, strong enough to imply the Comparison Lemma C2.2.3 but general enough for the application in Lemma C5.2.5!