Remove genesis_404 hook from genesis_loop [closed]

I found a solution for this problem:

For some reason, the add_action() and remove_action() had to be contained inside another action, genesis_meta:

add_action( 'genesis_meta', function () {
    if (is_404()) {
        remove_action( 'genesis_loop', 'genesis_404' );
        add_action( 'genesis_loop', 'genesis_customizations_404' );
    }
}, 11);