"Had we not been steadfast upon it," meaning: upon their worship. Allah said: "And they will come to know when they see the punishment," when they see the punishment in the Hereafter, "who is most astray in path," meaning: who was most astray in path in the world; meaning: they shall come to know that they were more astray in path than Muhammad.
﴿لَوْلَا أَن صَبرنَا عَلَيْهَا﴾ عَلَى عِبَادَتِهَا، قَالَ اللَّهُ: ﴿وَسَوْفَ يعلمُونَ حِين يرَوْنَ الْعَذَاب﴾ إِذْ يَرَوْنَ الْعَذَابَ فِي الْآخِرَةِ ﴿مَنْ أضلّ سَبِيلا﴾ أَيْ: مَنْ كَانَ أَضَلَّ سَبِيلًا فِي الدُّنْيَا؛ أَيْ: سَيَعْلَمُونَ أَنَّهُمْ كَانُوا أَضَلَّ سَبِيلًا مِنْ مُحَمَّدٍ