Many of the patients who tested the drug lost about 30 percent of their body weight — a loss comparable to the result of bariatric surgery