I think beneficiary trumps everything. But we are talking about what you could do with the money if you were (undeserving) beneficiary. Giving it back to the dead person (precisely donating it to their estate) is the right thing to do although probably imperfect because donations are often taxed.