CF7 Ajax isn’t working when called inside WooCommerce “woocommerce_before_add_to_cart_button” hook [closed]

I am not sure when the woocommerce_before_add_to_cart_button action fires in the request sequence, but it could be worth adding the following code to your functions.php to see if it loads the CF7 js script files,

add_action('wp_enqueue_scripts', 'pre_register_cf7_files');
function pre_register_cf7_files(){
  wp_register_style('contact-form-7', wpcf7_plugin_url( 'includes/css/styles.css' ), array(), WPCF7_VERSION, 'all' );
  wp_register_script( 'contact-form-7', wpcf7_plugin_url( 'includes/js/scripts.js' ), array( 'jquery' ), WPCF7_VERSION, true);
}

If this does not work, your only solution will be to hook your custom_before_add_to_cart_btn function earlier in the request sequence.