LEHI, Utah — Mitt Romney wound his way through this city’s tulip festival on Monday, shaking hands, hugging toddlers and shrugging off his failure to sew up the nomination for an open Senate seat at this state’s Republican Party convention last weekend.

“I don’t think it was any particular surprise for us,” he said. “We’re going to have a primary, and we’re ready for it.”

On Saturday, after a raucous day of voting at the Utah Republican convention, delegates delivered 49 percent of their votes to Mr. Romney, and 51 percent to a little-known state legislator named Mike Kennedy, who likened himself to the stone of the shepherd boy David, “ready to be flung at the foes of liberty.”

The vote pushed the two into a June 26 primary. And it led to speculation that Mr. Romney’s bid for the seat of Orrin G. Hatch, who is retiring, would not be as easy as expected — and that perhaps his once biting criticism of Donald J. Trump had become a political liability.