This is another call by way of rebuke for those who worshipped other gods besides Allah. The Lord, may He be exalted, will call to them before all the witnesses, and will say:
أَيْنَ شُرَكَآئِىَ الَّذِينَ كُنتُمْ تَزْعُمُونَ
(Where are My (so-called) partners, whom you used to assert) meaning, in this world.
وَنَزَعْنَا مِن كُلِّ أُمَّةٍ شَهِيداً
(And We shall take out from every nation a witness,) Mujahid said, "This means a Messenger.''
فَقُلْنَا هَاتُواْ بُرْهَـنَكُمْ
(and We shall say: "Bring your proof.'') meaning, `of the truth of your claim that Allah had any partners.'
فَعَلِمُواْ أَنَّ الْحَقَّ لِلَّهِ
(Then they shall know that the truth is with Allah,) meaning, that there is no god besides Him. Then they will not speak and they will not be able to find any answer.
وَضَلَّ عَنْهُمْ مَّا كَانُواْ يَفْتَرُونَ
(and the lies which they invented will disappear from them.) they will vanish and will be of no benefit to them.
Maududi - Sayyid Abul Ala Maududi - Tafhim al-Qur'an
A witness": the Prophet who had warned that community, or a rightly-guided person from among the followers of the Prophets, who had performed the duty of preaching the Truth in the community, or a means through which the message of the Truth had reached the community.
That is, "Present a cogent argument in your defense so that you are pardoned. You should either prove that the shirk and the denial of the Hereafter and Prophethood in which you persisted were the correct creed and you had adopted it on rational grounds, or, if you cannot do that, you should at least prove that no arrangement had been made by God to warn you of this error and guide you to the right path."