The error you encountered is likely due to the incorrect usage of the include statement. The correct syntax for passing variables to an included snippet is slightly different. Here’s the corrected code for your product page:
{% if product.metafields.custom.personalize != blank %}
{% include 'personalize-button' with button_text: 'Personalize' %}
{% endif %}
Make sure to replace custom with the appropriate namespace for your metafields.
In your “personalize-button.liquid” snippet, you can access the button_text variable using the include object. Here’s an updated version of the snippet: