OTTAWA — It was the sort of audience meant to be a natural fit for Prime Minister Justin Trudeau of Canada — more than 300 young women taking part in a “Daughters of the Vote” day of civic engagement in Parliament. But no sooner had he begun to speak than several dozen of the women stood up and dramatically turned their backs on him.

“Respect the integrity of women & indigenous leaders in politics,” Deanna Allain, one of the participants, said in a tweet aimed at Mr. Trudeau earlier this month. “Do better.”

Try as he might, Mr. Trudeau can’t seem to move past the controversy that has sucked up most of the air in Canada since February, when the country’s first Indigenous female attorney general quit after accusing the prime minister’s office of inappropriately pressuring her to consider a civil rather than criminal penalty for a company accused of corruption.

The episode has propelled Canada into an agonized, bad-tempered and occasionally hairsplitting argument about the rule of law, the exigencies of party loyalty and the role of women, Indigenous people and feminism in political life.