A Ph.D. is usually a collection of papers/chapters, so even if a fatal flaw is found in one of the chapters, it does not normally result in "failing the Ph.D." It just means that that particular paper isn't publishable. The bar for getting a Ph.D. is actually quite low; what is truly difficult is clearing the bar in terms of publications for academic positions and later tenure.

You would have to go back and do more work though, and if you couldn't fix it you would have to do another defence. But yes, it is a different situation to actually getting a good post doc.