1. Strictly speaking the all the steps taken after the property was mortgaged with the ending Bank is wrong anf illegal.
2. The sale of his mortgaged property by X to you without taking Bank's approval is illegal.
3. Since the sale of the property to you was illegal, your sale of the same property to Y is also illegal.
4. Now, when you paid off the outstanding of X to the Bank, did the Bank return you the original title deed of the property deposited by X with them to you?
5. By submitting the said Affidavit, what financial gain do you think X can attempt for? Since he has already sold his said mortgaged property to you, he cannot deny that sale.
6. Did Y issue the cheque for that earnest money in favour of you and you deposited the amount by issuing another cheque to the Bank or the said cheque towards the earnest money was drawn directly in favour of the Bank which you have deposited to them? If the said cheque was directly drawn to the Bank without any tripartite agreement executed by and between you, your seller and the Bank, then it was wrong to draw the said cheque in favour of the Bank and deposit it with them.
7. However, mentioning the cheque in the sale deed will be of legal advantage to you.
8. All my above comments have been made considering that both the sale deeds i.e. from X to you and from you to Y have been registered otherwise those deeds have no legal value.
9. You should pursue the complaint you have already filed with police.