Period. You needed to have never given 20000 in cash to a stranger. First and foremost, you should have not accepted an expired passport. Second, you should have taken a copy of his Qatar ID and a receipt that he received some money from you with the purpose of selling his car to you through this and this bank, the receipt bearing the transaction details. You should ideally have made someone accompany you, as a witness, just in case.

I would have liked if you had lost your money, you would have learnt a good lesson (I learnt it this hard way though). It is not faith in humanity, it is stupidity. Cash is cash, you can not trust the air with it.