He did not say this on his own, but being high (archiereus | ἀρχιερεύς | nom sg masc) priest that year he was prophesying that Jesus was about to die for the nation,
Reference
John 11:51
Sequence
65