Sometimes writers forget things. I once looked at a copy of Isaac Asimov's Prelude to foundation, one of his later novels tying together his different earlier fictional series.
The introduction had a list of his novels in chronological order of their fictional events, and it put The Currents of Space BEFORE, not AFTER, The Stars Like Dust. That is such an obvious mistake that I am sure he would have corrected it as soon as someone asked about it.
So the more methodical writers actually write chronological charts of their future or alternate history, so they don't forget and have a character age 20 in a story when he is actually minus fifteen,and so on. And they make maps of cities and nations and planets, and space maps of interstellar space, and so on. They write biographies of their characters and check them and revise them every now and then to keep them and the stories consistent.
J.R.R. Tolkien was near one extreme of a writer who wanted to keep everything consistent and otherwise right and correct, while Sir Arthur Conan Doyle was an example of a famous writer near the other extreme who didn't think about consistency much.
And of course a shared universe like a TV series needs to be methodical - more methodical than many shows actually are.
By the third season of the original Star Trek a conscientious would-be writer might have been able to gather a few extra sources of information besides the third season writers guide. There were a few fanzines already, including Star Trek: The Analysis of a Phenomenon in Science Fiction (1968) which included among other things an unusual description of how the transporter worked and the first ever chronology of Star Trek. There were The Making of Star Trek (1968) and "To Make a star Trek" G. Harry Stein, in Analog Feb. 1968. And there was the first version of the Star Trek Concordance.
IN an introduction to a book by L. Sprague De Camp, Isaac Asimov commented on De camp's intensive research for his historical fiction, including a map of the ancient Acropolis at Athens for a story where his heroes had to escape from it, and so on. But in De camp's Lest Darkness Fall a man transported back in time to 6th century Rome asks for directions from the Pantheon to the Forum, and arrives at the Forum despite being told to turn left where he should turn right.