WASHINGTON — Heading into Friday’s impeachment hearing, the Republican strategy for dealing with Marie L. Yovanovitch was simple: treat the ousted ambassador to Ukraine with respect during her testimony on Friday and avoid any appearance of bullying a veteran diplomat who had been vilified and driven from her post.

President Trump blew up the plan.

Ms. Yovanovitch had just begun to recount, in powerful and personal terms, the devastation and fear she felt when she learned Mr. Trump had attacked her during a July 25 phone call with the president of Ukraine. She was “shocked, appalled, devastated that the president of the United States would talk about any ambassador like that,” she said.

It was just the kind of human moment that Republican members of the House Intelligence Committee had anticipated — a political trap they were determined not to fall into. But they apparently didn’t anticipate how Mr. Trump would react.

“Everywhere Marie Yovanovitch went turned bad,” Mr. Trump wrote on Twitter, sneering at her to his 66 million followers while recounting an earlier posting in her diplomatic career. “She started off in Somalia, how did that go?”