Don't you have to pay back advances? Never heard of that happening for failed investments outside of fraud
It depends on your contract. Usually, poor sales won't result in needing to repay an advance. However, there are plenty of other clauses that the contract could contain that would lead to the contract being canceled and potentially the advance having to be repaid (due to delays, editorial disagreements, poor quality, etc.)