Gary Johnson, the Libertarian Party presidential candidate, who has struggled in recent weeks to recover from a gaffe in which he was unable to identify Aleppo, in war-torn Syria, appeared to fumble once more on Sunday when he said no one had been injured in two violent events in New York City and Minnesota over the weekend.

“Well, first of all, just grateful that nobody got hurt,” Mr. Johnson told CNN’s Brian Stelter in an appearance on the network’s “Reliable Sources.”

In fact, 29 people were injured in an explosion in New York’s Chelsea neighborhood on Saturday, and nine people were stabbed in St. Cloud, Minn., before the suspect was shot and killed by an off-duty police officer.

Mr. Johnson, a former Republican governor of New Mexico, has been an object of curiosity for younger voters, as has Jill Stein, the Green Party nominee. Some establishment Republicans who do not support Donald J. Trump have been drawn to Mr. Johnson and his running mate, William Weld. The two campaigns have also been a source of alarm for Democrats, who fear that a third-party threat could shake up results in the coming election.