I love the way I’ll surprise myself in the middle of a manuscript. I’ll be writing a chapter with a specific idea in mind, and something completely unexpected and wild will happen. This can be good or bad--good if it enhances the plot; bad if it takes the story in a direction it’s not meant to go. In the latter case I will eventually run into a dead end and have to backtrack to where the story derailed. It’s important to check your roadmap (your outline) periodically to ensure your creative detour isn’t getting you hopelessly lost.
Just because your wayward idea doesn’t work with this novel doesn’t mean you have to discard it. Save it for another journey. One day you might come back this way with a new book.