It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that he said (about the verse "And it is not for a prophet to act unfaithfully"): "How could it not be possible for a prophet to be betrayed, when he could even be killed? Allah Almighty has said: 'And they kill the prophets without right.' Rather, the hypocrites had accused the Prophet (peace and blessings be upon him) (of misappropriation), so Allah Almighty revealed this verse: 'And it is not for a prophet to act unfaithfully.'"
Related hadith on this topic