It happens to everybody. Sometimes the book is awful.
But here’s the thing. Even if you write something that is truly terrible, you can always go back and fix it. From an editor’s standpoint, things are fixable. Yes, you may have to rewrite a lot of it, and you may have to throw out certain chapters or rework some crucial points.
But if you have a passion for this story line or topic, there’s a reason. Stick with it, and see what happens.
Every book I have ever written was worth it. I have spent hours and hours on stories that stink. In their current state, very few people will ever see them, yet I am a better writer because of them. They were completely worth it because I needed to practice. I learned valuable lessons by writing those books, and who knows? Someday they just might come to life again.
You can use your “bad” books the way a mechanic would use a damaged car. Take out the pieces that work and stick them in a newer, better car, so the new car—the one you actually want to drive—will run properly.
Nothing is a waste when it comes to writing. You can always go back and make something better, or you can use pieces of it in a brand new way.