Generally speaking plot isn't the most important thing to a Doctor's final story. Nor is it the most important thing to a Christmas episode. There's usually a hint of it though, something simple to keep the Big Important Moments (such as a showdown with the chief baddie or the introduction of the new lead actor) hanging together. Twice Upon A Time is unusual in that it foregoes plot entirely.
What we get instead of a plot is a disjointed mix of obscure Moffat era references1 and one final attempt by a departing showrunner to exert his will and vision over earlier eras of the programme. There was no reason for the First Doctor to be in the episode beyond a very tenuous crisis of conscious over regenerating idea that was never fully explained. It's the sort of thing that could work nicely as an eight minute TARDIS set scene for Children in Need2. More is needed for an hour in prime time however, even on Christmas Day.
The captain was a more excruciating addition. He was there so Moffat could give his pal Mark Gatiss one final role, cramming in the name Lethbridge-Stewart as he did it.
These have been recurring complaints throughout Moffat's time running the show. It's fitting that they're present in the episode that closes his era. As is the case with that other Moffat staple of recycled ideas. Specifically The Testimony being a time travelling organisation that pulls people out of their timelines at the moment of death, an exact copy of the Teselecta in Let's Kill Hitler.
Meanwhile another classic Moffat trope (perhaps the classic) of technology not fully understanding the people it's interacting with and that causing problems could be seen to be inverted here, with the Doctors not understanding the way the Testimony shipped worked until the final fifteen minutes, and this lack of understanding giving reason for the running about that was going on. It would be nice to think this was a deliberate inclusion by Moffat, closing off the idea by reversing it, but it was almost certainly just a coincidence.
It's a shame for Capaldi to go out on such a weak episode. The ingredients were there for something interesting. The idea of the First and Twelfth Doctors meeting moments before they both regenerate could have been interesting. The Testimony, a time travelling church that interviews people before they die, could have been interesting. A database at the centre of the universe is a bit bland, a bit Hitchhikers, and has been done before, but still could have been interesting. You really don't have to look that hard to see a version of this episode, ideas reconfigured and the lead character given something to do, that's interesting and contributes something to the legacy and canon of the show. That it falls so short is deeply frustrating.
Twice Upon a Time is the perfect exit for Moffat, a man who's spent the majority of his time in the producer's chair disappointing and underwhelming. It's a poor exit for Peter Capaldi. His acting capability could have made his one of the all time great eras of the show. He just needed someone willing to write to his strengths and he wound up with Steven Moffat. Capaldi's Doctor was the biggest waste of the Moffat era.
That era is, thankfully, behind us now. At this point it's impossible to know whether the Chris Chibnall will turn out to be good or bad, but we do know it will be different. Right now that's what the show needs.
Just ignore the fact that his first scene as showrunner3 sets the stage for either a return to a UNIT family-esque setup, an introductory episode that's similar in premise to The Eleventh Hour, or calls on the amnesiac-Doctor-trapped-on-Earth stories the EDAs did...
1 Why was Rusty in this? Just why?
2 ... or maybe a Big Finish audio.
3 Jodie Whittaker's first moments as the Thirteenth Doctor were pretty much what you'd expect. She got to say something brief and positive about having regenerated into a woman before demonstrating that she doesn't have full control of her faculties (by this point a trope in new Doctors that people fully expect to see), gently tapping what turned out to be the flush-everything-out-into-space button to give us a tensionless cliffhanger. It told us precisely nothing about how she'll play the part.