Catherine Troisi, an infectious disease epidemiologist at The University of Texas Health Science Center at Houston, studies Covid-19. When, wearing a mask and standing at the edge of a great swell of people, she attended a recent protest in Houston supporting Mr. Floyd, a sense of contradiction tugged at her.

“I certainly condemned the anti-lockdown protests at the time, and I’m not condemning the protests now, and I struggle with that,” she said. “I have a hard time articulating why that is OK.”

Mark Lurie, a professor of epidemiology at Brown University, described a similar struggle.

“Instinctively, many of us in public health feel a strong desire to act against accumulated generations of racial injustice,” Professor Lurie said. “But we have to be honest: A few weeks before, we were criticizing protesters for arguing to open up the economy and saying that was dangerous behavior.