Please contribute generously in order to ensure the continuity of our website InshaAllah.
Praise be to Allah.
Prayer in the mosque is valid, and no attention should be paid to what some of the elders are saying with no foundation. Based on what you have said, the documents that the person who sold you the land had are proof that the owner of the land does indeed own it, unless something to the contrary can be proven. So the words of some of the elders do not carry any weight here, especially since those who are in charge of the waqf of that land are present and have not asked for it.
So carry on praying in the mosque, and do not pay any attention to words that are thrown about with no shar’i proof. Those who warn against praying there should fear Allaah, and not repeat the words of others so long as it is contrary to the facts. They should support their words with shar’i evidence, otherwise it is not permissible for them not to pray in this mosque, let alone warn others and stop them from praying there.
You say in your question, “The charitable foundation that built the mosque is prepared to buy the land again if it is proven that it is a waqf”. It is not permissible to sell a waqf, but if the mosque to which this land was donated as a waqf has no need of it, it is permissible to sell it to someone who will build a mosque on it, which is what has been done. That is if it is proven that this is a waqf.
May Allaah help you to do that which pleases Him. We ask Him to accept your righteous deeds. And Allaah knows best.