I used a different way,
<script>
jQuery(document).ready(function($){
let productName = '';
$(document).on('click', '.elementor-button-link', function() {
productName = $(this).closest('[data-product-name]').data('product-name');
});
$(document).on('elementor/popup/show', function() {
if (productName) {
$('#form-field-product_name').val(productName);
}
});
});
</script>
then in the button in loop, Advanced Tab (not the link one) > Attributes > click on the dynamic tags gear icon > select product or post title > after you selected it click on the wrench icon > in before field add (data-product-name|). in the form make field ID (product_name).