In On Writing: A Memoir of the Craft, Stephen King says that sometimes characters "begin to influence the course of the story instead of the other way around" (p. 190) and "every character you create is partly you." (p. 191)
It's always nice to have a highly successful writer reflect my own experience. Every character has a bit of the writer in there - even villains. But sometimes a character develops in unexpected ways and takes over the story.
When I started writing Peg's Story: Detours, I was identifying strongly with Peg. While her initial relationships and situations were different from my experience, her feelings and reactions were what I'd expect mine would be in her place - until she got to the bus station and I found her behaving in ways that absolutely shocked me.
The character had taken over. I couldn't force her into behaving differently - it wouldn't fit. Knowing people always think I'm writing about myself, I was too embarrassed to continue. The manuscript got put away for many months.
Then I saw a documentary in which they interviewed women who had been trafficked, and I realized that was Peg's story - the man at the bus station wasn't just another sleaze, he was a trafficker targeting a traumatized girl to draw her into his stable.
Yes, I left home (when I was almost twenty) and took a bus to Harrisburg and my fiance, and we went through the same storm Peg experiences. However, my fiance was not a pimp; we got married that summer and moved to a college town.
Throughout the rest of the novel, I use experiences from my twenties (like sailing on San Francisco Bay) but put them into the context of Peg's journey, not mine. I also throw in a good bit I never experienced first-hand, but researched thoroughly. In the end, it's Peg's story, her detours. I like to think the part of her that is me is the part that gives her the resilience she needs.