I wrote 17,358 words of a book before I realized it wasn't going to work. Scrapped it all. Two years later I tried again, plotted every scene of my book from start to finish, and I wrote the entirety of the manuscript in just under three months, no plot holes. 86,234 words.
In the grand scheme of things, 10K is discouraging but not a death sentence. Maggie Stiefvater deletes about the length of a whole book from her whole book before she reaches a final draft. Re-writing is just as much part of the process! Casualties happen, and Rome wasn't built in a day. You can do it!
I recommend taking some time to reevaluate, find someone to discuss the in-depth aspects of your plot, and eventually, you'll figure out how to patch up that hole. Good luck, my dude, I believe in you.