The builder cannot cancel the agreement unilaterally, it is illegal and breach of contract. He can be drawn to civil court seeking specific reliefs besides specific performance of contract.
You have stated to have approached court, which court, civil or consumer, what was the relief sought before the court.?
The details of payment and the demands the builder made with regard to the alleged exorbitant interest are to have been brought out in the legal notice or in the pleadings in the case filed before court.
The slab wise agreement for payment of installment payment should not have been changed to date wise which has gone against you.
You may get the amount paid along with the interest if the builder expresses inability to provide the flat since he has already sold to a third party, the interest on it may be insisted.