If your intention is that your policy monies should go to a particular person only then you need to assign the policy in that person's favour. Thereafter the insurer will pay the policy monies ONLY to the assignee who becomes its owner, irrespective of whether he or she is your legal heir.
Thanks to assignments, the proceeds of a policy can be protected against the claims of any of the policyholder's creditors. Assignment is a legal instrument and the insurer cannot be held responsible for its legal liability. The insurer will nevertheless register the assignment in its books.