People with a DNA mutation that reduces their chance of HIV infection may die sooner, according to a study that suggests tinkering with a gene to try to fix one problem may cause others.

The study authors cited the case of the Chinese researcher who tried to produce this mutation in twin girls before their birth, to reduce their risk for HIV. His work, which produced the first gene-edited babies, was widely condemned as unethical and risky, and the new paper illustrates one reason for concern.

"You should consider all the effects of mutations you induce," said Rasmus Nielsen of the University of California, Berkeley, senior author of the paper, released Monday by the journal Nature Medicine.

Nielsen acknowledged that his result cannot be applied directly to the two girls in China. For one thing, his study focused on a sample of people in the United Kingdom who may have different genetic backgrounds than the Chinese girls.

In addition, the people he studied had inherited a specific mutation. The Chinese scientist tried to create the same mutation, but failed. The girls now carry different alterations in the same gene.

The gene is called CCR5. When it is working normally, it lets certain cells of the immune system display a protein on their surfaces. HIV has co-opted that protein to use as a doorway to infect those cells. The mutation prevents that protein from appearing, and so sharply reduces the risk of HIV infection.

Past studies have suggested that carrying the mutation has some drawbacks, including a heightened risk of death from flu.

Nielsen and Xinzhu Wei, also at UC Berkeley, studied data on about 400,000 people who'd signed up between 2006 and 2010 for the UK Biobank, which collected extensive information on them and is following their health. They compared people who carry the mutation in both copies of their CCR5 gene to those who carry it in just one copy or neither, and looked for deaths recorded through February 2016.

About 4,000 participants carried the mutation in both copies, of whom 151 were dead. Analysis focused on deaths between ages 41 and 76.

The study found that participants with the mutation in both copies had a death rate about 20 percent higher than that of the others. A second analysis showed that at the time participants signed up for the databank, when their average age was about 57, there were fewer people with the mutation in both copies of the gene than one would expect. That's another sign of a higher death rate.

The researchers were unable to get information on the causes of deaths, so they have no firm explanation for the difference in mortality, Nielsen said. But the heightened risk of death from flu may have played an important role, he said. He also said the size of the difference would probably differ in other groups of people.

Dr. Philip Murphy, an immunologist at the National Institute of Allergy and Infectious Diseases in Bethesda, Maryland, said the work provided the first peek at the mutation's effect on mortality from all causes over a wide swath of the lifespan. "That's a big deal," he said.

Nielsen said the study does not apply to a form of gene therapy that differs from what the Chinese researcher did. Some scientists have been inactivating CCR5 in blood cells of people already infected with HIV, to help keep the virus under control. In that situation, having the disabled gene is probably an advantage, Nielsen said.

James Riley, who studies that strategy at the University of Pennsylvania, agreed. Riley said his work affects only a tiny fraction of blood cells, while people in Nielsen's study with the higher death rate had CCR5 shut off in every cell of the body.

Dr. Anthony Fauci, head of the NIAID, said the new study did not apply broadly to gene editing experiments underway now. Researchers are mainly focused on replacing a defective gene with a working one, or eliminating a harmful one. In contrast, the people in Nielsen's study were living without a normal, working version of a gene, a condition the Chinese researcher sought to produce.

Fauci said the work is more a lesson that genetic protection against one thing can raise vulnerability to something else.

FOLLOW NBC HEALTH ON TWITTER & FACEBOOK