can you try the below code?
{% for tag in product.tags %}
{% if tag contains section.settings.badge_name %}
{{ tag }}
{% endif %}
{% endfor %}
Also, you should define the badge_name setting in your schema block like this
{
"type": "text",
"id": "badge_name",
"label": "Badge Name",
"default": "Bestseller"
}