Natural selection depends on environment, which changes all the time. A gene that is advantageous today might become fatal tomorrow so asking whether a gene is self defeating doesn't maker sense without specifying the environment. Floods, asteroids, droughts, fires, and so on are all random events that constantly change things up so only genes that are foundational to our biochemistry are immune to selective pressure - largely because most mutations in those genes are catastrophic or the genes are very redundant.
Humans have a complex social environment on top of everything else so whether a gene is useful or not might depend on which ideology is in power, the predominant religion of the day, or hygiene etiquette.