The Quran isn't a Textbook. The purpose of the Quran is to guide the spiritual and moral life of the people, not to provide technical documentation on the working of the world. Non-muslims who expect every single sentence of the Quran to be literal and scientifically accurate, even when taken out of context are being unreasonable ... muslims who expect that are misguided and delusional.
Large parts of the Quran are narratives. Like any good narrative and poem (Quran is a Rhyme in original Arabic), language is used to create atmosphere, words are used creatively to have desired effects, vocabulary is used to evoke and maintain a certain tone and rhythm. Common expressions, phrases and idioms are used and convoluted sentences are avoided. It would sound totally absurd if every sentence was literally scientifically accurate.
At 18:86 the Quran is telling us a story of a man named "Dhul-Qarnayn" ( a conqueror, similar to and sometimes disputably linked with Alexander the Great), who once traveled west until sunset, until he saw the sun setting in a body of water:
Quote from abridged English translation of Tafsir Ibn Kathir:
Until, when he reached the setting place of the sun, means, he followed a route until he reached the furthest point that could be reached in the direction of the sun's setting, which is the west of the earth. As for the idea of his reaching the place in the sky where the sun sets, this is something impossible, and the tales told by storytellers that he traveled so far to the west that the sun set behind him are not true at all. Most of these stories come from the myths of the People of the Book and the rabricationsfabrications and lies of their heretics. "he found it setting in a spring of Hami'ah,"meaning, he saw the sun as if it were setting in the ocean. This is something which everyone who goes to the coast can see: it looks as if the sun is setting into the sea but in fact it never leaves its path in which it is fixed.