It's very frequent that "Team A" works on a software product and gets some of it done. Then the work gets sent to "Team B".
"Team B" usually finds many deficiencies at work in the code. For instance, people frequently bungle the design of 10-table databases, so perhaps there are dragons in the 100s of tables.
"Team B" sometimes delivers the product, usually late. Sometimes it doesn't.
That's life. The Gartner Group says that 2/3 of all IT projects fail and I think that's about par for the course.
First: why is that? Are there good reasons for this, and does this happen for those reasons?
Now, knowing nothing about the company, if I learn that every other project suffer a change of team before going into maintenance (officially and actually), then it's substantial evidence that something is wrong with management.
Whether one should quit of course depends on how wrong.
Like @angdis said elsewhere in this discussion, projects "fail" all the time, but the OP is talking about a specific kind of failure. Notice how many commenters mention "finger-pointing" and "paper trail". When you find yourself in a situation where that becomes important, it's time to consider leaving and it's always better to leave on your own terms.
Unless you're deeply invested in that project or that company, it's usually better to start looking for a place where projects fail more gracefully than this.