No that's not correct.
In case of purchasing property form NRI first you should ask a certificate from your seller which he will provide you from his AO which will mention his capital gain amount and TDS amount. You need to deduct TDS at that amount.
If he cant provide you with that then you need to deduct TDS from sellers amount on sale value and that needs to be done at 30% and not 20% as 20% is for TDS on long term capital gain amount.
Hope you find the information helpful if you do please rate it 5 and provide your valuable feedback for my improvement.
Thank you.