Hadith Where Prophet Burnt The Ants
I don’t know about the veracity of the chain of narration of this hadith, but prophets of God, whilst morally superior than the general population, have emotions and use their intellect as well. Not all of their actions and utterances are divinely guided. When the ant bit incident took place, it could be that prophet ordered the nuisance to be eliminated, similar to how we suggest eliminating the bee hive, which sometimes harms the passerby or those who accidentally comes in contact with the territorial bees. In spirit, the bees are following God’s command of making honey, but Human intellect exhort us to remove any undue nuisance. Similarly, it is possible that the ant had a colony near the place where they bit Prophet Muhammad, and as a result, prophet Muhammad asked to uproot the problem. Here is where the wisdom and unparalleled guidance was probably revealed, where Allah imparted that the whole colony had some other errands too (worshipping) apart from just biting. Surah Abasa, is another similar example, frowning upon a genuine seeker of truth is not what people will regard prophet Muhammad with, it was a momentary happening and natural, but Allah guided him and told him about viewing things from a different perspective.
Please also refer to the video below from 30:32 to 40:47 ( specifically from 37:32 onwards ) https://www.youtube.com/live/Dt_3CVKVueo?si=X3aLj1AK7Xx2K8FW&t=1832