In Deadpool 2, we see him rolling through the mansion in Professor X’s wheelchair. When he asks where all the others are again, we get a quick shot of them in a room where they quickly close the doors so Deadpool can’t see them, but all the X-Men are the 70s/80s versions of them. How can that be when the DP movies take place in the modern day? Was it just a riff on the “confusing timelines” joke from DP1?
Out of universe it is just a joke Easter Egg to play off from the joke in Deadpool as you mention and we aren't supposed to think too hard about it. They likely used the younger versions of the characters just because it was easier to get a hold of them considering they were filming for Dark Phoenix and they are now the new faces of the characters.
Director David Leitch told us how the shot came together. “That was interesting because Simon Kinberg was filming X-Men: Dark Phoenix in Montreal at the same time we were doing Deadpool,” he told Den of Geek. “So this was in the script but we were always wondering how we were going to be able to pull it off. The set supervisor, Dan Glass, who did the Matrix films, he came up with this idea of doing a composite, and getting the plates to match.
“So we shot our side here, and we sent the measurements and the camera positions and things up to Simon's team on Dark Phoenix, and they shot the plate for that there,” continued Leitch. “Then we put the two together. So actually it turned out to be easier than we thought. If we would have had to get all those people in the room it probably wouldn't have happened.”
Missing from the scene is Mystique (Jennifer Lawrence) and Jean Grey (Sophie Turner), with the latter especially notable since the movie chronicles her transformation into the title entity.
“It might have been one of those things where we're up against it,” said Leitch about Turner’s absence. “And it's like, who's available that day by the time we had to get the shot and get it down to us…we're grateful to have anyone we could get at that point.”
Evan Peters, the actor for Quicksilver, also notes that they were only told just before the shot was done that they were doing it. So it was kind of like a last minute decision to get it done.
"We were shooting [the upcoming X-Men: Dark Phoenix], and they were like, 'Hey we're going to do this quick thing for Deadpool 2 real fast, we gotta get everyone together so let's do it," Peters recalled.
"We did a bunch of different versions, some not PG, and they ended up using that one," Peters said. "I thought it was going to be for the end credits -- and I think everybody kinda did -- but it ended up being like, boom, right there sort of in the first half of the film. Which was really sort of weird and shocking."
In universe it isn't explained and I don't think it really needs to be considering it was just used to enhance an earlier joke to make it even better. One could theorise that Cable, Deadpool or Negasonic used Cable's time travel device to bring them forward just for a laugh at Deadpool's expense. However, considering Wade doesn't even see them this is unlikely.
It's just one of those things that isn't explained and doesn't really need to be because it's just a joke. After all Deadpool is all about not taking itself too seriously, having a laugh and breaking the fourth wall.