Releasing a sample after being caught doesn’t square with being identified by DNA from the weapon the day before.
Nor does a familial match from one of the ancestry outfits, because that doesn’t happen in a day, much less a matter of hours, not even for the police.
If it’s true he was identified by DNA and not the gun registration, since he left it there (which honestly, sounds more likely), then his DNA was on the law enforcement database in connection to a criminal investigation, either as a suspect or a victim.