1. first of all check from the registration department if there is any registered agreement between the builder and X
2. in absence of a registered agreement, the finance company could not have accepted the flat as security towards its loan repayment by X
3. No lender lends money to a borrower without a proper registered title document in the name of the borrower
4. if there is no registered document between builder and X, then it would mean that X got possession of the flat from the builder without a registered agreement and he mortgaged the flat with the lender - so ask the lender company to produce all the relevant documents submitted to it by X for the loan and what all documents were executed pursuant to sanction of loan by lender in favour of X
5. Also before you bought this flat, did you carry out a search from the registration department and issued public notice in newspapers of your intention to buy this flat from the builder? if you have done that exercise and you did not receive any objections pursuant to your public notice or did not find any adverse entry in the search report pertaining to your flat, then you become a 'bonafide purchaser for value without notice'