I read a suggestion once, in the early days of Psi Phi, that all the licensed ST fiction that doesn't "fit" can be explained similarly to Alan Dean Foster's take in his "Star Trek Log" series of TAS adaptations: that he is transcribing/novelizing from the official officers' logs. (He even alters the as-scripted stardates to match the new order of events as he unfolds them over ten volumes, rather than use airdate or production order.)
As in any historical novel, authors will take some liberties with the material, extrapolating missing bits of information, glamorizing other bits, maybe even adding/changing characters to give readers what the authors and editors think is the best reading experience. Works for me!