Hell, look no further than screen Trek for contradictions - Spock had no familiarity with practical cloaking devices in Balance of Terror, but the Suliban has them in Enterprise. The Emperor’s New Cloak hinged on cloaking technology not existing in the Mirror Universe, but Through The Looking Glass had several Alliance ships decloak.
Oh, those are easy to explain, because realistically, there would be an ongoing arms race between stealth and detection. Any given cloaking technology would become useless as soon as a way to penetrate it was discovered -- and we saw the various crews discover ways to detect cloaked ships several times, e.g. by the thruster exhaust in TUC or by tachyon emissions in DS9. So there wouldn't be just one cloaking system, there'd be a succession of different cloaking systems. Once the existing system was penetrated, it would be rendered obsolete, and cloaking would again be purely hypothetical until someone invented a new, superior kind of cloak.
Of course, the real explanation is inconsistency in the writing, but it's fortunate that this happens to be an inconsistency that makes perfect logical sense in-universe, because it would
not make sense for a single stealth technology to remain in use for over 200 years despite being penetrated on various different occasions. It also accounts for the differences between the various portrayals of cloaking -- the "Balance of Terror" version was detectable by "motion sensors" (whatever those were), the TSFS version had that telltale ripple that others didn't, etc.
The Federation-Cardassian conflicts happened through the early TNG seasons, but we have several declarations of “The Federation hasn’t been at war in decades” and “Starfleet is not a military!” in that same time.
I'd phrase that the other way around -- TNG's creators started off depicting a Federation at peace, then a few years later, "The Wounded" retconned in a war during that same period.
“Canon” and “continuity” are ultimately no more than the commonly accepted collection of things, things which can, as dictated by story needs, be acknowledged or discarded. Trying to fit everything in a continuous line isn’t just impossible, it’s often even missing the forests for the trees, because there are some very good Star Trek stories, in print and onscreen, that can’t be reconciled perfectly with everything.
"Canon" just means a collection of stories. Stories are human inventions and thus imperfect and changeable, so canons are imperfect and changeable too. Continuity is a device
used by stories, not the sole overarching priority of stories. It's something you use when it helps you tell the stories you want, but that can be deferred when it interferes with telling the story. Ultimately, all fiction is just pretending and creating illusions. The illusion of a continuous reality is certainly useful, but sometimes you just have to pretend that something previously portrayed as X was actually Y all along, and ask the audience to pretend along with you for the sake of enjoying the story.
Ironically, it makes all feel less unified than we're used to, since bombshells that altered the novelverse became rare to logically impossible fairly quickly after the novelverse became a major thing.
Before, really. The only reason it was feasible for Pocket to attempt an ongoing 24th-century continuity in the first place was because the 24th-century shows weren't being made anymore. The DS9 Relaunch began the year after DS9 ended, the VGR and TNG post-finale books waited until after those series' finales, etc. No real ongoing novel continuity was feasible until the TV/movie continuities had ended and there was nothing onscreen to contradict the books.
Books that come out during a series are always a different animal. They're trying to keep up with a moving target. The series itself will be reinvented on the fly as the creators change their minds or new creators replace them with different ideas, so it's always going to be a struggle for any tie-ins to stay consistent with that.