«لَئِنْ أَشْرَكْتَ لَيَحْبَطَنَّ عَمَلُكَ»
If you were to associate partners with God, your work would surely be nullified.
The address is to the Prophet ﷺ, but the hypothetical condition must not be treated as an assertion that he committed or would commit shirk. The condition states the gravity of a rule through a posited premise, even where the premise is not to be understood as actually occurring of this addressee.
A conditional can thus describe a supposed relation without asserting the truth of its antecedent. One must distinguish supposition, actual report and accusation.