Jesus was talking to Jews who rejected Him as very God. This is why He would reject them in the judgment despite their works.