21. Are you sure that it was him that you saw last evening?
You are correct! The sentence is grammatically incorrect.
The subject of the clause "that it was him" is "it." The verb is "was," a variant of the verb "to be." That verb does not take an object. Instead, it takes a subjective completion. Therefore, the "subject" form of "him," i.e., "he" is needed.
Therefore, the sentence should read: "Are you sure that it was he that you saw last evening."