Jesus knew the Scriptures. And I don't see any contradiction. The belief in an afterlife comes from the Old Testament and it is confirmed by the teaching Jesus gave us and by the writings of the apostles - Peter referred to the people of old, the men who perished in the flood and the men of Sodom and Gomorrah, saying the LORD knows how to keep the unrighteous under punishment until the day of judgment. 2 Peter 2:4-10.
Your assumption - The OT teaches the dead are dead. Yet I see many references to Sheol and the Pit. Isa. 38:10, Pr. 1:12, Psalms 143:7, 88:4, 28:1, Job 33:22
Ezekiel 26:20
then I will thrust you down with
those who descend into the
Pit, to the people of old, and I will make you to dwell in the nether world, among primeval ruins, with
those who go down to the
Pit, so that you will not be inhabited or have a place in the land of the living.
Ezekiel 31:14
All this is in order that no trees by the waters may grow to lofty height or set their tops among the clouds, and that no trees that drink water may reach up to them in height; for they are all given over to death, to the nether world among mortal men, with
those who go down to the
Pit.
Ezekiel 31:16
I will make the nations quake at the sound of its fall, when I cast it down to Sheol with
those who go down to the
Pit; and all the trees of Eden, the choice and best of Lebanon, all that drink water, will be comforted in the nether world.
Ezekiel 32:18
“Son of man, wail over the multitude of Egypt, and send them down, her and the daughters of majestic nations, to the nether world, to
those who have gone down to the
Pit:
Ezekiel 32:24
“Elam is there, and all her multitude about her grave; all of them slain, fallen by the sword,
who went down uncircumcised into the nether world,
who spread terror in the land of the living, and they bear their shame with
those who go down to the
Pit.