I made up the sentence "if he finished the task at X o'clock, he will come here not later than Y o'clock".
Can the sentence be correct in some context? According to rules, this isn't zero or first or second or third conditional.
This is a perfectly correct sentence. As written it implies that X o'clock is in the past, but Y is in the future. If X were in the future the sentence would be written as:
If he finishes the task at X o'clock, he will come here not later than Y o'clock."
The implication is that the task might or might not be completed by X, the speaker does not know. If it has been (or will be), then "he" will (should) arrive by Y time.
Please remember that the categories of "zero or first or second or third conditional" are simplifications used for teaching purposes, and do not capture every conditional expression that is valid in English grammar. They are not used in academic formal grammatical analysis. And English is famous for not having strictly observed rules in any case.