Exactly — it is stated in the episode that the "entity" is capable of both suppressing and inventing memories to make certain its captives remain belligerent—I was surprised how distrustful of Starfleet and the crew Mara is given her encounter with them in this book. She‘s originally afraid of Starfleet death camps and torture. I suppose this falls in the same category as Chekov’s hatred of Klingons for killing his brother.
SPOCK
Captain, I am constrained to point out that
since minds are evidently being influenced,
we cannot know at this moment whether
our own memories are completely accurate
and true.
This is why, despite the events of Harm’s Way, Kang and Mara remain hostile toward Kirk and his crew, and why Chekov doesn't remember Mara — but it also provides a subtextual justification for how and why Kirk and Spock are able to persuade Mara and Kang to ally with Kirk and his crew against the entity.