The objection correctly observes that the present Al-Aqsa building was constructed after the Prophet Muhammad (PBUH). But it assumes that Quran 17:1 uses "mosque" to mean a completed building standing in its later architectural form. The verse does not require that assumption.

What the objection gets right

The argument is serious: the Second Temple was destroyed by the Romans in 70 CE, and the large Islamic structures now associated with Al-Aqsa were built later, especially under the Umayyads. If the Quran meant that Muhammad (PBUH) was taken to the exact building that visitors see today, this would create a historical problem.

Classical commentators do identify al-Masjid al-Aqsa with Jerusalem. Ibn Kathir describes it as Bayt al-Maqdis, the sacred house in Jerusalem, and al-Jalalayn likewise explains it as the sanctuary of Jerusalem. Their point is the location and sacred precinct, not that the later Umayyad building already existed in its present form.

What "mosque" means in this verse

The Arabic masjid literally means a place of prostration or worship. It does not always refer to a particular constructed building. In Islamic usage, the earth itself can serve as a place of prayer. Thus, a sacred worship site may be called a masjid even when no roofed mosque stands there.

Glory be to Him who took His servant by night from al-Masjid al-Haram to al-Masjid al-Aqsa, whose surroundings We have blessed, so that We might show him some of Our signs.

Quran 17:1

The verse itself adds that the area around it was blessed. This wording points naturally to a known sacred locality and its precinct, not necessarily to a surviving temple building. The name "Al-Aqsa Mosque" was subsequently used for the prayer complex built on that sacred site; the later construction does not mean the site itself came into existence only then.

The hadith describes the event, not later architecture

Authentic reports describe the Prophet Muhammad (PBUH) arriving at Jerusalem, tying al-Buraq, praying there, and meeting the prophets. Another report mentions that the prophets were gathered for him and that he led them in prayer. These reports establish the sacred destination and its religious meaning. They do not say that a particular later building, with its later walls and roof, already existed.

Then I was brought al-Buraq. I mounted it until I was brought to Jerusalem. I tied it at the ring where the prophets used to tie their mounts, then I entered the mosque and prayed two units.

Sahih Muslim, account of the Night Journey

So the historical evidence may challenge a simplistic picture in which the current Umayyad structure was already standing. It does not establish an anachronism in Quran 17:1. At most, it shows that "al-Masjid al-Aqsa" should be understood as the ancient sacred site and worship precinct of Jerusalem, not restricted to the building that bears that name today.