Remove duplicate product link from WooCommerce Page Row Actions

Quickie

Run only when you need to run and only run where you need to run

Your code is almost there but you are not running at the particular time,if we use the your code it runs first and then filtered again by WooCommerce. So we have two options.

  1. Change priority of the filter
  2. Hook the code to run properly

I think just unsetting $actions['duplicate'] should work , i’m unsure why you have other variables also(Let me know if you have a purpose).

Change priority of the filter

function my_duplicate_post_link($actions, $post) {

    // The following checks WHERE we should run if not products just return
    if ( $post->post_type != 'product' ) {
        return $actions;
    }

    $product = get_product( $post->ID );
    unset($actions['duplicate']);
    return $actions;
}

// Notice priority changed from default 10 to 15(anything greater than 10)
// Priority defines WHEN we should run
add_filter('post_row_actions', 'my_duplicate_post_link', 15, 2);
add_filter('page_row_actions', 'my_duplicate_post_link', 15, 2);

Hook the code to init

add_action('init','wpse_227130_hook_properly');

function wpse_227130_hook_properly() {
    add_filter('post_row_actions', 'my_duplicate_post_link', 10, 2);
    add_filter('page_row_actions', 'my_duplicate_post_link', 10, 2);
}

Remember init action runs after all plugins loaded and best place to run code.