I think we all have had to dump our efforts down the drain. It’s sad and it really sucks. For me, it was complacency that had a hold of me.
In the beginning, after a few all grain batches under my belt, I started brewing horrible beers. After a while, I came to the conclusion that good beer does not come by accident. Since than, I make sure I’m on my game with every batch and while every batch is not “award winning”, I have not had to dump, or try to enjoy, a bad batch in about 7 years — knock on wood.
Sanitation and attention to detail was the key for me.
I suggest you jump back on that horse and take a ride.