If the book flops, you should not be expected to return this advance. Do not expect to get rich on royalties earned in academic publishing. Note that the royalty rate will vary dependent on the type of right sold. For instance, a German publisher may pay a fee for the right to translate and publish a German edition. Here you could well get 50 per cent of that fee.
Some publishers allow authors to buy any of their books at a certain discount.
Provided your royalties exceed a minimum amount, you should expect to receive payment of any royalties annually. At the very least, you should receive a statement itemising sales of your book. We often see the latter in Scandinavia, where a common sum paid is about DKK 30,000. This sum seems high and some people argue that any subsidy is a form of vanity publishing. However, the real cost of publishing an average book is about double this amount.