I think you will find that he tax is taken, via the Notary, from the amount you receive for the flat. In our experience, it took a couple of weeks for the Canton to agree the amount of tax due and the sale then proceeded with 3 separate payments; the 10% deposit, the tax and the balance.

That's just our experience, others may be much more informed about this.

Normally, except in Argau, the purchaser is jointly liable for this tax if the seller absconds without paying it, so the purchaser attempts to protect himself and ensure that the seller really does pay the tax, by withholding it, or paying it directly etc.

The first question is how long you have owned the property. The capital gain tax is calculated on a percentage basis based on ownership. In the 25th year of ownership the percentage on the gain is 5%. In the first year it is 40%.

Improvements made to the property, notar costs and selling costs can all be deducted from the gain.

You should talk to the tax authority in the Gemeinde where you live. They should be able to help you. The other alternative is to see a tax specialist in Kanton Aargau.

The join liability is given but the purchase contract will usually protect the buyer from non-payment of the gains tax.

What might be interesting if whether they allow you to deregister before it's calculated and paid. From experience, you get a first bill and then supply evidence to reduce it. I would liaise with an accountant and maybe think about some POA contract for this if you want to leave in a hurry.