Three months after Danielle Schwarz began taking antibiotics for a severe case of acne, her doctor began to notice a disturbing pattern among her patients—this mainstay treatment for the skin condition increasingly wasn’t working.

“I was canceling plans, didn’t want anyone to see me,” says Ms. Schwarz, a 25-year-old bank analyst in New York.

Her...