And the author looks at her outline and remembers the entire point of this excursion to the treasury is to retrieve a gemstone that glows on its own. And that she had had the king, being no idiot, put said gemstone up where it would illuminate the treasury.
Good place for it.
Outlining has its uses in keeping the story from careening off into the wilderness, where it perishes for the lack of food. As long as you follow it. But sometimes the Muse goes zipping along and does something
Still, sometimes it has to eyeballed to determine if the changes are really to load-bearing portions of the plot. Perhaps it really was just local color that looked good at the time. Or perhaps it's not incompatible, and there's just the matter of molding together what was written and what was outlining -- like, say, giving the treasury an antechamber beside the main room, where the gem shines radiantly onward.
Then, of course, there's always the excise entirely and restart. An often overlooked choice, because it's so annoying to have to throw away stuff that's been written.