The president’s advisers had hoped the health care measure would give the White House a much-needed burst of momentum and prove to wary Republicans that it was worth sticking with Trump in order to accomplish something the party had sought for seven years.