Firslty, whenever you are going to purchase any property, there has been a presumption for the party purchasing to inquire about the property at least little bit.
Secondly, you can do it by going through the registrar’s office and see if there is any existing transaction on it or not.
Thirdly, but, yes it is also not feasible for a party to go to court and find out any such thing.
Fourhtly, it is the fault of the seller not you, so please be in the possession of the flat let them fight in the court.
Rest, would feel fortunate to help you further in future...!