Mr. Trump has accused women of having “fat, ugly” faces and of repelling voters because of their looks. He called one woman a “crazed, crying lowlife” and said another was a “dog” who had the “face of a pig.” He said Hillary Clinton’s bathroom break during a 2015 presidential debate was “too disgusting” to talk about. He has repeatedly mocked women for being overweight.

“This rhetoric is the kind of thing that has turned off college-educated Republican women who voted for Trump in 2016, but have fallen away,” said Debbie Walsh, the director of the Center for American Women and Politics at Rutgers University. Calling the president’s comment “adolescent,” Ms. Walsh said that “you cannot continue to be a party in power if the voters that you are appealing to are white men over the age of 60.”

Mr. Trump’s turn toward juvenile mockery illustrates why even those Republicans who were buoyed by the bounce they received in the aftermath of Justice Brett M. Kavanaugh’s nomination were still cautious in their midterm forecasts: One can never guess when this president will veer off message, as he did on Tuesday with Ms. Clifford.

“To say this is unbecoming of any man, let alone the POTUS, is a vast understatement,” tweeted Representative Ryan A. Costello, a Pennsylvania Republican who is retiring from Congress, referring to the president. “And to say this enables teenage boys to feel they have a license to refer to girls w such names is obvious. It’s all very embarrassing.”