And do not take your oaths as [means of] deceit between you, lest a foot slip after it was [once] firm, and you would taste evil [in this world] for what [people] you diverted from the way of Allāh, and you would have [in the Hereafter] a great punishment.
(And had your Lord willed, all of those on earth would have believed together.) 10:99, meaning, He could have created harmony among them, and there would not be any differences, conflicts or hatred between them.
(And if your Lord had so willed, He would surely, have made mankind one Ummah nation or community, but they will not cease to disagree. Except him on whom your Lord has bestowed His mercy, and for that did He create them.) (11:118-119) Similarly, Allah says here:
An oath sworn to deceive someone may cause forfeiture of Faith ('Iman)
Verse 94 which begins with the words: وَلَا تَتَّخِذُوا أَيْمَانَكُمْ دَخَلًا (do not take your oaths as a means of mischief) gives yet another instruction to stay away from getting involved in what is a great sin laden with evil consequences. It means that anyone who at the very time of taking an oath harbours other ideas and intentions, is all set to act counter to the oath taken while going through the exercise of oath-taking merely to deceive the other party, then, this would be an act far more dangerous than that of breaking a common oath. As a result, the danger is that this person may end up being all deprived of the very asset of'Iman (faith). The sentence which follows immediately, that is: فَتَزِلَّ قَدَمٌ بَعْدَ ثُبُوتِهَا (lest a foot should slip after it is firmly placed - 94), means exactly this. [ Qurtubi ]
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 93–94
There are unfathomable aspects of this world. Truth and untruth are not separate and distinct. The reason for this is to be found in the plan of God by which He created this world, a plan designed to ascertain the true moral fibre of each and every individual on this earth. Indeed, man has been brought into this present world for the purpose of being tested. This purpose would not have been served had man not been given the freedom to accept or reject God’s word. He had to have the freedom to show truth to be untruth and to present untruth in the shape of truth. If God had not had this in view, he would have subjected all human beings to His orders, just as He did with the rest of the universe. This state of affairs will be perpetuated till the Day of Judgement. On the Day of Judgement it will be clear as to who used his judgement correctly, and who ignored the Truth for the sake of self-interest. At that time God will mete out to each individual such treatment as will be commensurate with his or her performance during the period of trial in the present world.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.