An MSNBC panel concluded on Tuesday that Sen. Ted Cruz (R-TX) was devastated after being outsmarted by former acting Attorney General Sally Yates at Tuesday's Senate hearing because he thinks he's "the smartest person in the room."

On MSNBC's Morning Joe program, host Joe Scarborough noted that Cruz had tried to cite U.S. law to corner Yates about why she questioned the legality of President Donald Trump's travel ban. But Yates quickly pointed out a newer section of U.S. code to justify her actions.

"Do not set it up like Perry Mason unless you know the answer," Scarborough advised. "He should have known -- that's just bad theater, that's just bad politics. He should have known that Sally Yates was going to hit his hanging curve ball 470 feet."

"She cited correctly the provision of the law that was implemented after the section that he talked about," the MSNBC host said.

"But it's also something that Ted Cruz has done more often than not," MSNBC contributor Mike Barnicle added. "He has an intellectual contempt for nearly everyone because he thinks he's just the smartest person in the room."

MSNBC contributor Steve Rattner observed that Cruz doesn't hide his disdain for others.

"What's even worse, he shows it," Rattner remarked. "It's obvious he has an intellectual contempt for everyone that's in the room."

Watch the video below from MSNBC, broadcast May 9, 2017.