Avengers: Endgame is quite packed with references to other movies. But I rewatched Avengers: Age of Ultron a little while ago and I realized that at least Tony Stark's vision (given to him by Wanda Maximoff) seemed to be a direct foreshadowing of the destruction of Thanos entering the universe in the third act of Endgame. What other, if any, scenes or references in Ultron foreshadow events in Endgame?
Age of Ultron is the opening act for the running theme of conflict between Cap and Stark, which is theoretically the reason why Endgame became necessary. After all, the tragic flaw of the Avengers is that their egos get in the way of what they could accomplish together. This results in them losing people, and finding humility. Eventually they overcome their problems and work together in Endgame, to at least correct their biggest mistake.
That theme exists in miniature within Age of Ultron. Tony and Bruce want to march forward, Cap wants to be more careful. They don't work together, and many people die. Including half of the twins, a direct parallel to the Thanos snap. While this is more of a thematic reference than a direct one, I think it is why these two movies are tied together as bookends of the story.