It also depends on genre/company. If you write a commercial book and it doesn't do well, you're probably not in a great position. If you write a literary book and publish with a more literary publisher, they sometimes give more leeway, because they're looking to develop a readership and praise a bit more. There are so many variables here, that it's hard to answer.