As with any franchise that has been around 50 years, Star Trek has a number of plot holes and continuity errors. The last show, Enterprise, was veritable font of these kinds of questions, which is always a problem when you’re making a prequel.
TV Tropes’ Wild Mass Guessing page for Enterprise is ripe with fan theories to explain some of the more egregious breaches of continuity. But the one that I find the most persuasive is the idea that all of the show we watched was actually a holodeck program running on the Enterprise-D.
Not that the people in it weren’t real, but that they weren’t entirely accurate portrayals of the “real” historical figures in the Federation. The broad outlines are correct, the niggling details are not. They’re wrong because only so much is declassified and some records are just incomplete. Heck, if the whole program is based solely off of a source like Archer’s logs, you could see how things got distorted.
This is a theory that makes it easier to deal with the early, confusing, seasons of Enterprise and fit it into the greater Star Trek universe.