Scientific Error In The Quran
The verse is about the heavens, not particularly about the sun. The heaven is very far away from our solar system. So the earth along with the solar system might have been created before and then the matter of havens was taken up. Moreover, in such matters scientific statements are based on probability and plausibility, they are not proven facts.