Mr. Macron’s office pointed to his policies that aim to reduce inequalities — like splitting up overcrowded classes in schools in disenfranchised neighborhoods, which his government did during his first term, or guaranteeing that middle schools in those areas stay open later to help struggling students, a promise that he made just this week in Marseille.

But, the official acknowledged, “We have a lot of catching up to do.”

Nahel, a fan of rap and motorbikes, was raised alone by his mother in Nanterre. He had a few minor run-ins with the police involving reckless driving and failure to comply with traffic stops, but had recently joined an association called “Ovale Citoyen” that helps youths from difficult backgrounds through involvement in sport — in this case rugby.

“For me, Nahel was an example of a kid from an underprivileged neighborhood, unschooled, sometimes borderline but in no way a big-time bandit, who really wanted to make his way,” Jeff Puech, the president of the association, told the Sud Ouest daily.

For Mr. Macron, Nahel’s death has come at an awkward moment. As a wave of protests against his decision to raise the retirement age began to die down in April, he promised that within 100 days he would galvanize France through a series of measures, including tax cuts for the middle class and massive investment in vocational schools. Those 100 days will be up on July 14, Bastille Day, the French national holiday.

Perhaps France’s divisions are now just too deep, and the resentment toward Mr. Macron from those left behind in France too acute, for healing to be possible. When the president tried this week, even before the shooting, to tell people in La Busserine, a poor northern suburb of Marseille, about his revival program for the city, some shouted him down.