Misbehaving Prophets (علیہم السلام) is to misbehave with Allah

(4) These verses denounce the hypocrites for trying to be clever with Allah Himself and to deceive Him, although no one among them could probably have had such an intention or even thought of such a possibility. What they were actually doing was to try to deceive the Holy Prophet ﷺ and the Muslims. Allah has equated this effort with an attempt to deceive Him, and has thus indicated that a man who is in any way impertinent to a prophet or a man of Allah is ultimately guilty of being impertinent to Allah Himself - this should be true above all in the case of the Holy Prophet ﷺ who stands in his station at the head of all created beings.