The murderer has to leave the DNA sample somewhere in the scene or on the victim.
No they don't.
Crooked or incompetent cops, prosecutors and crime labs can make it happen through selective analysis, cross contamination, poor record keeping...you name it.
Sure, been watching too many cop shows? That scenario is much different than matching to a relative’s DNA. If the cops already have a DNA sample then that provides the match and they don’t have to rely on the still rather remote chance that a close relative has submitted a sample to a genealogy service that will turn up a match and that they can place the suspect anywhere near the crime without a reasonable doubt.
Possible yes, improbable yes again.