The local lawyer is correct
The PoA from X to A and his son ought to have contained a power to sell the 50% share of X and to receive money on behalf of X and comply with registration formalities
A PoA intended for authorising someone to sell property is compulsorily required to be registered as per the Maharashtra Stamp Act. This is required so that the party does not evade paying stamp duty on sale transaction. There were practices when a owner would sell his property through a PoA enabling the buyer to deal with the property on behalf of grantor seller and the seller would also execute a Will in favour of the buyer so that after demise of seller (when poa becomes useless), the buyer would be protected under the bequest made in the Will. This entire transaction would be done to evade stamp duty payment on the sale deed, resulting in loss of revenue for the government. That is why the legislature passed an amendment to the stamp act making registration compulsory for a power of attorney containing a power to sell
However in your case stamp duty is not the issue as on the sale deed between X (through his poa holder A) and A, full stamp duty is paid
But absence of authority/power to sell in the poa and non knowledge about actual receipt of consideration by X from A, would create issues in future
Especially when you intend to sell this flat and the buyer is buying through a bank loan. The bank will obviously raise that issue. And banks raise issues on small irrelevant things and refuse to sanction loan. So you may find it difficult to find buyers if such buyers avail bank loan
The declaration from X is a good idea. However as X is abroad, instead of normal notary, it is advisable to have the declaration attested by Indian Consulate or Embassy in that country
I have come across instances where foreign notaries are not accepted in India
The attested declaration of X can be attached to your sale deed so that it forms part of registered document
If you can have X as confirming party in your sale deed, then nothing like it
You just need to email the draft agreement to X, he can take print on green ledger and then sign it before indian embassy
For registration purpose, a normal POA can be taken in your favour to comply with registration formalities on behalf of X
The POA from X to you also needs to be attested and signed before Indian Embassy and it may also require another procedure of apostille
If X is a confirming party in your sale deed then it will remove the clout on your title
If above is too cumbersome then the declaration signed and attested as explained above would suffice