If the message isn't compatible with the existing lore IMO pick a different message, make up an original story without the pre-existing lore, or find a different world to make a story about where it does work.
Though I doubt it's often the case where the existing lore is incompatible with whatever message but lazy or negligent writing where they either didn't know or didn't care about the conflicting lore but it would have been possible to massage the story to work with both.