Praise be to Allah, and may peace and blessings be upon the Messenger of Allah.
There is no contradiction between these texts, because the events and stages of the Day of Judgment are multiple. The texts may describe one situation at one stage and then describe another situation at a later stage.
It is authentically reported in the hadith that a caller will call out on the Day of Judgment: “Let every people go to what they used to worship.” Thus, the polytheists will follow their objects of worship, and then they will be driven to the Fire.
Their following them does not mean that those objects of worship are pleased with their worship or that they will help them. Rather, the false objects of worship will disavow them and deny that they were worshipped by them. Thus, the following is from the side of the polytheists, while the denial and disavowal are from the side of the objects of worship.
Allah تعالى says:
“On the Day when He will gather them and those whom they worshipped besides Allah, He will say, ‘Was it you who led these servants of Mine astray, or did they themselves stray from the way?’ They will say, ‘Glory be to You! It was not for us to take any protectors besides You.’” [Al-Furqān: 17–18]
And He سبحانه says:
“And on the Day He will say, ‘Call upon My partners whom you claimed.’ So they will call upon them, but they will not respond to them, and We will place between them a barrier of destruction.” [Al-Kahf: 52]
And Allah تعالى says:
“And on the Day We will gather them all together, then We will say to those who associated partners with Allah, ‘Stay where you are, you and your partners.’ Then We will separate them, and their partners will say, ‘You did not worship us.’” [Yūnus: 28]
Thus, the objects of worship that were worshipped besides Allah will deny this worship and disassociate themselves from their worshippers, because they did not command them to worship them and were not pleased with it. Indeed, some of them are incapable of understanding worship at all, such as idols.
Then the polytheists will become even more certain of their error and more despairing of their objects of worship, as Allah تعالى says about them:
“Where are those whom you used to associate with Allah—besides Him?” They will say, “They have vanished from us; rather, we did not used to call upon anything before.” [Ghāfir: 73–74]
The polytheists following their objects of worship on the Day of Judgment does not mean that those objects of worship are pleased with them or that they can benefit them. Rather, this following ultimately leads to exposing the falsehood of polytheism and the inability of those objects of worship. They will then disavow the polytheists and deny that they worshipped them. This will be among the means by which the proof is established against them and their error is made clear.
And Allah تعالى knows best.