The writing process is a learning process. As such it involves some degree of repetition.
In other words writing and rewriting. It probably won't work out right on the first draft--at least not if it's long. It's hard enough to get something to work out as a first draft when it's only a few hundred words. If it's thousands of words, or tens of thousands, or even a hundred thousand, getting it right on the first try is going to be a lot more difficult.
I think I write most efficiently when I just dive in and don't fear having to rewrite. It helps that I no longer worry about rewriting. The more practiced I become as a writer, the easier it is for me to formulate a good plan for works large or small, and the easier it is to write a decent first draft. But it's also easier to simply scrap a draft and start again from the blank page.
Another iteration. The next iteration does not need to scrap the ideas of the previous iteration, but it can build on them and refine them. It need not scrap all the words of the previous draft, but ought only take those that suit the new vision--but honor the new vision, not the old words.
I think there might be some kind of freedom in planning on having to rewrite. It means that you can get the ideas down in a rush without worrying about getting them down perfectly. Your intention is to refine a work. Therefore, this is a sort of permission to make mistakes, which often frees up the perfectionist. There's also a certain inevitability: if you know you have to rewrite, you have to start by writing and so you can resign yourself to a lengthy task rather than resisting with the hope that somehow it will become easy. It won't.
The irony is that by embracing the work, the project becomes easiest. If you're writing quickly and freely, often you can produce better work than when you're trying to get a perfect draft. I can't prove it, but I think that by embracing the idea that a lot of work must be done, you reduce the amount of work that you actually have to do because you work better when you're not resisting the work.
In short, get ready to do it again.