Donald Trump’s path to the Presidency as an outsider always implied on-the-job-training. This week’s lesson: The world is not a Republican primary. President Trump’s Twitter broadsides against Mexico have unleashed a political backlash that has now become a diplomatic crisis with a friendly neighbor.

Mr. Trump fancies himself a negotiating wizard, but in this case he is out-negotiating himself. The White House announced last weekend that Mr. Trump had asked Mexican President Enrique Peña Nieto to Washington to talk about...