BIARRITZ, France—President Trump clashed with world leaders over the U.S. trade war with China and a host of foreign-policy issues at a Group of Seven summit that showed his isolation on the world stage.

A weekend of meetings at this sea resort included an unexpected visit by Iranian Foreign Minister Javad Zarif at France’s invitation that caught some U.S. officials off guard.

Mr....