Of course, the people who wrote these things knew that Jesus had been killed. So they had to embellish the story of Jesus's life. He had been resurrected ahead of everyone else.
When he was alive, Jesus didn't know he would be killed, and so could not actually have spoken of a second coming. (I do not for one second believe he had actual foreknowledge. I do not believe in the supernatural.)