Background:

During the siege of Medina, in the Battle of Trench, there were rumours that Banu Qurayzah (a Jewish tribe, which resided inside Medina) were betraying Muslims and they were to attack Muslims with the help of Meccans. Nevertheless, those rumours proved wrong and neither Banu Qurayzah practically helped the Meccans, nor they killed or even injured a single Muslim.  Muslims were freely coming in and out of the area of Banu Qurayzah during that siege, which continued for one month  (Sahih Bukhari, Hadith 3721). There was no Trench present where Banu Qurayzah resided, but they didn't allow Meccans to enter their area and attack Muslims from the backside. 

When the Meccans eventually lifted the siege and returned to Mecca, the Muslims also put down their weapons and engaged in bathing. At that point, neither the Muslims blamed Banu Qurayzah for any betrayal nor did they rush to attack them.

The circumstances suggest that it was Dihyah al-Kalbi, a companion of Muhammad, who first suggested him to blame Banu Qurayzah for betrayal, and then attack them for getting a lot of spoils of war and women. Muhammad also became ready for it, while he disliked the presence of the Jews in Medina. 

Muhammad also laid down his weapons, like other Muslims, and he was also taking a bath at Umm Salama's (one of his wives) house, Dihyah came to him and suggested that they should attack the Banu Qurayza, accusing them of treachery, and seize their women, children, and wealth.

Although Muhammad agreed with Dihyah al-Kalbi's suggestion, he still needed a pretext to carry out the attack. Thus, Muhammad once again claimed to receive a revelation, stating that Gabriel had appeared to him in the form of Dihyah Kalbi, commanding the Muslims to immediately attack Banu Qurayzah.

Ibn Kathir described the details of the Battle of the Trench and the subsequent attack on the Banu Qurayza tribe in the commentary of verse 33:26 (link):

When Allah helped him (i.e. Muhammad) by suppressing his enemy and driving them back disappointed and lost (in the battle of the Trench), having gained nothing, the Messenger of Allah returned to Al-Madinah in triumph and the people put down their weapons. While the Messenger of Allah was washing off the dust of battle in the house of Umm Salamah, may Allah be pleased with her, Jibril (i.e. Gabriel), upon him be peace, came to him wearing a turban of brocade, riding on a mule on which was a cloth of silk brocade. He said, "Have you put down your weapons, O Messenger of Allah'' He said, "Yes.'' He said, "But the angels have not put down their weapons. I have just now come back from pursuing the people.'' Then he said: "Allah, may He be blessed and exalted, commands you to get up and go to Banu Qurayzah.'' According to another report, "What a fighter you are! Have you put down your weapons'' He said, "Yes.'' He said, "But we have not put down our weapons yet, get up and go to these people.'' He said: "Where'' He said, "Banu Qurayzah, for Allah has commanded me to shake them.'' So the Messenger of Allah got up immediately, and commanded the people to march towards Banu Qurayzah, who were a few miles from Al-Madinah. This was after Salat Az-Zuhr. He said, (No one among you should pray `Asr except at Banu Qurayzah.) So, the people set out, and the time for the prayer came while they were still on the road. Some of them prayed on the road, saying, "The Messenger of Allah only wanted to make us march quickly.'' Others said, "We will not pray it until we reach Banu Qurayzah.'' Neither of the two groups were rebuked for what they did. The Messenger of Allah followed them. He left Ibn Umm Maktum, may Allah be pleased with him, in charge of Al-Madinah, and he had given the flag to `Ali bin Abi Talib, may Allah be pleased with him. Then the Messenger of Allah went to them (Banu Qurayzah) laying seige to them for twenty-five days.

But who was this Jibril (Gabriel)?

The problem arose that the person whom Muhammad called Jibril, people had seen him leaving the house of Umm Salamah, and it was Dihyah al-Kalbi. Upon that, Muhammad made an excuse that Gabriel came to him in the form of Dihyah al-Kalbi. 

Ibn Kathir further writes under verse 33:26 (link):

قالت فجاءه جبريل عليه السلام، وإن على ثناياه لنقع الغبار، فقال أوقد وضعت السلاح؟ لا والله ما وضعت الملائكة بعد السلاح، اخرج إلى بني قريظة فقاتلهم، قالت فلبس رسول الله صلى الله عليه وسلم لأمته، وأذن في الناس بالرحيل أن يخرجوا، فمر على بني تميم، وهم جيران المسجد، فقال " من مر بكم؟ " قالوا مر بنا دحية الكلبي، وكان دحية الكلبي يشبه لحيته وسنه ووجهه جبريل عليه الصلاة والسلام
Suddenly, Jibril (Gabriel) came to Muhammad and there was dust on his clothes. He asked, "Why have you put down your weapons, while the angels have not put down their weapons yet. Stand up and go out to the Banu Qurayza and fight against them." Then the Messenger of Allah wore his armor and ordered people to depart towards Banu Qurayzah. He passed by the houses of the tribe of Banu Tamim, who were living in the neighbourhood of the mosque of Muhammad (where the house of Umm Salama was situated), and asked, "Who passed by you?" They replied, "Dhahyah Al-Kalbi passed by us." Dhahyah Al-Kalbi resembled Jibril in his beard, teeth, and face.
Um Salama also caught that lie from Muhammad. She herself describes the incident in these words.

Sahih Bukhari, 4980:

Narrated Abu `Uthman: I was informed that Gabriel came to the Prophet (ﷺ) while Um Salama was with him. Gabriel started talking (to the Prophet). Then the Prophet (ﷺ) asked Um Salama, "Who is this?" She replied, "He is Dihya (al-Kalbi)." When Gabriel had left, Um Salama said, "By Allah, I did not take him for anybody other than him (i.e. Dihya) till I heard the sermon of the Prophet (ﷺ) wherein he informed about the news of Gabriel."

The question that arises in this situation is when Umm Salamah informed Prophet Muhammad that it was Dihyah, why didn't Muhammad immediately refute her and told that it was not Dihyah but Gabriel in the form of Dihyah?

Additionally, Muhammad asserted that Gabriel was causing the fortresses of Banu Qurayza to tremble and filling them with fear. With this claim, Muhammad aimed to mentally prepare his companions for war against Banu Qurayza. However, contrary to Muhammad's prediction, the fortresses of Banu Qurayza remained unaffected, and the Muslims were unable to achieve victory over them. Furthermore, the people of Banu Qurayza did not experience any fear towards the Muslims. Instead, they successfully defended their fortress for a month and only surrendered when their supplies ran out.

Sirah Ibn Hisham (link):

ومر رسول الله صلى الله عليه وسلم بنفر من أصحابه بالصورين قبل أن يصل إلى بني قريظة ، فقال : هل مر بكم أحد ؟ قالوا : يا رسول الله ، قد مر بنا دحية بن خليفة الكلبي ، على بغلة بيضاء عليها رحالة ، عليها قطيفة ديباج . فقال رسول الله صلى الله عليه وسلم : ذلك جبريل ، بعث إلى بني قريظة يزلزل بهم حصونهم ، ويقذف الرعب في قلوبهم

The apostle passed by a number of his companions in al-Saurayn before he got to Banu Qurayza and asked if anyone had passed them. They replied that Dihya b. Khalifa alKalbi had passed upon a white mule with a saddle covered with a piece of brocade. He said, 'That was Gabriel who has been sent to B. Qurayza to shake their castles and strike terror to their hearts.'

Now, who can refute these claims of Muhammad that Gabriel brought him the revelation? And if Umm Salamah or the people of Banu Tamim also caught Muhammad that it was not Gabriel but Dihyah, then the next excuse is ready that Gabriel appeared in the form of Dihyah.

Let us employ our reasoning and contemplate:

  • Why did Gabriel not manifest to Muhammad in his usual unseen form?
  • What purpose did it serve for Gabriel to appear in the form of a human?
  • Instead of providing any advantage, it only resulted in confusion among people.

P.S:

After having the Banu Qurayza slaughtered, Muhammad, without any excuse or pretext, expelled the remaining small Jewish tribes in Medina (such as Banu Harithah and Banu Salam) from Medina. This time Muhammad didn't even try making any effort to fabricate an excuse, as was done in the cases of the previous three major Jewish tribes (Banu Qaynuqa, Banu Nadir, and Banu Qurayza).

They were expelled from Medina without any valid reason, even though they had not committed any treachery. Their only crime was that they refused to acknowledge Muhammad as a true prophet, which he could not tolerate. They were not just expelled from the city; when Muslims gained more power, Muhammad issued a new order to expel all Jews and Christians from the entire Arabian Peninsula (Sahih Muslim, 1767a).