Six people I asked to beta read my work completed it and had useful feedback about where the story lagged or where it might be confusing, but two of them (a third of my readers!) didn’t like the ending. They wanted a happy ending for the characters that they had invested in, and I don’t write those. I strongly feel that protagonists must face the consequences of their actions, and sometimes those consequences are heavy.
I guess the silver lining is that they cared enough about the characters to be upset about the ending.
Now obviously, when I’m looking for an agent, I’d be sure to find one that is happy with the current ending. But what happens if we sign with a publisher? Is it possible that a publisher would have a similar view as a third of my beta readers? Could they be thinking “it’s got promise and once we sign, we’ll fix the ending”? Does a writer have any control at that point?
If the publisher tries to radically change a book after the author signs, can the author withdraw the book?
If the author doesn't want to do the edits or changes that the publisher asks for, it's entirely possible to pay back all the advance money and cancel the contract. (You'll end up paying back the agent's commission portion too--we did our job and sold the book. You back out of the deal, we don't give the money back)
This doesn't happen often, but it does happen.
The way to avoid this is to have an agent who asks the right questions of the editor: do you love the book? do you think there are major changes? if you do, what are they?
The editor doesn't want to sign up a book and work on it for months only to have the author disagree and back out of the deal. The editor will have some serious explaining to do up his/her food chain, and those are NOT fun conversations.
Your agent should know before going on submission that changing the ending is a deal breaker for you. That will help her figure out what questions to ask when negotiating the deal.