Remarkably, a Parliament that in February debated whether to deny Mr. Trump a state visit because, among other reasons, it could embarrass Queen Elizabeth II, found itself taking on that question once again.

For Mrs. May, the episode has been simultaneously an embarrassment, a diplomatic setback and a lesson in just how hard it is to manage her relationship with Mr. Trump, a leader she has tried hard to cultivate…

Criticism swelled well beyond Parliament, encompassing figures such as the comedian John Cleese, and Brendan Cox, the husband of the Labour lawmaker, Jo Cox, who was murdered by a right-wing extremist last year.