Likewise, when Allah declares His Book free of doubt, contradiction, uncertainty, or any report contrary to fact, this is because it guides with perfect certainty in every field, encompasses all rulings, exhibits flawless coherence, and speaks with absolute truthfulness—together with the rest of its noble qualities.
In the same vein, when He absolves His Messenger—may Allah bless him and grant him peace—of lying, of fabricating against Allah, of following caprice, or of being afflicted with madness, sorcery, poetry, and the like, this is to establish the perfection of his truthfulness—that he does not speak from desire; it is nothing but revelation sent down—and to affirm the soundness of his intellect and the removal of anything that could cast doubt on the perfection of his prophethood and messengership.
Therefore, keep this principle in mind whenever you come across Qur’anic verses about these and similar matters, and you will gain abundant benefit. Allah knows best. (1)