hmm it seems like the bible actually has a more realistic outlook:
ecclesiastes disagrees, sure.. but the other bit you cited confirms it, too:
Isaiah 51v6 is dealing with Babylon. Babylonian policy was not letting captives return home, but God's people will and did return home. God will work that out.
The 'heavens' of verse 6 are 'governmental heavens' or ruling powers in this case Babylon who will be broken in defeat.
The 'earth' or earthly society of Babylonian subjects are subjects of those ruling powers which will also come to their end.
Even the greatest world power can not prevent or interfere with God's ability to save his people.
Please note Isaiah 34 vs 1-4,10
The literal heavens above us appear curved. On ancient scrolls the writing was on the inside and when finished the scroll was put away.
Governmental heavens can come to an end just like being inside a rolled up scroll. Their 'stars' [high-up-there leaders] will also loose their shine.
The smoke of Edom [v10] will go up forever. We know Edom is not smoking today but the smoke pictured how final the destruction would last. > forever.
Psalm 102v26 continues.... wear out like a garment.... but then notice that....
like something worn out can be changed, > they will be changed.
The earth although subject to decay, or wearing down erosion process,
is still being changed or replenished by volcanic activity, etc.
Notice what God uses to renew earth's face at Psalm 104v30.
Almighty God supplies the needed abundant energy.-Isaiah 40 vs26,28
Besides Ecc 1v4 B saying the earth remains or abides forever,
Psalm 104v5 says the foundations of the earth will Not be removed forever.
Psalm 78v69 says earth established forever.
Psalm 96v10 the world established not be moved
Psalm 93v1 the world established...can not be moved
1st Chron 16v30 earth, the world is stable, [not totter] that it be Not moved.
Jeremiah 10vs11,12 false gods perish from earth, Not the earth.
Isaiah 45v18 mentions earth established...not in vain...formed to be inhabited.
So Ecclesiastes is not disagreeing, but Psalms meaning that if God would not sustain the earth, step in, earth would not be resilient and bounce back from abuse, but since it is God's will that we and the earth remain forever,
then God will have the earth change [change its worn out clothing]
and refresh and replenish itself.
Perhaps you recall Jesus promise referred from Psalm 37 vs11,29
that the meek will inherit the earth. Dwell on the earth forever.
In order for the humble meek to be here forever so would the earth have to be here forever. What will Not be here forever is: wickedness.
Psalm 37vs38-40; 92v7; Proverbs 2vs21,22; 10v30; 21v18; Isaiah 11vs3,4.