This is why thought experiments like the Trolley problems don't have a simple answer.. and they get even more complex with variations of the thought experiment.
However, please tell me which model of ethics supports eugenics. Is it Utilitarian, Rights, Fairness, Common Good, or Virtue?
What single gene that only causes bad things to happen do you have in mind? Are you sure it doesn’t also control unrelated activity that’s helpful to the population?
As to what specific gene or sets of gene in mind to alter, that depends on what you define as "bad things" and what is possible.
From a rapid google search, Cystic Fibrosis seems like a candidate.
Genetic engineering is probably acceptable to most under all five. You’d probably still have ethical arguments. GE has ethical arguments raised against it in general, but let’s not go into the baby and bathwater arguments here. Editing genes in a fertilized egg or a blastomere has different ethical implications than doing gene editing in a fully born person. It’s different for a patient who can consent and for a child, too.
Cystic fibrosis usually leaves men mechanically sterile, although not carriers and men with CF can still have children through medical/surgical interventions. Its complications are ever more treatable. There are over 2500 known mutations of this gene, accounting for about 30 different disorders including CF. Which mutations would you screen for? Who among the population would you screen - known carriers? People with any CF in their extended family? Everyone?
I can think of little modern philosophy more regressive than the idea that a self-appointed superior can determine that another is inferior to the point that they (or their offspring) should be culled from existence. Eugenics and racism have been intertwined since the beginning and with a modern twist continue to target vulnerable populations.