Why does my product page appear empty after applying a customer tag filter?

I wanted to block out the products under a specific collection from others who can access the product via direct url.

So what I did was to copy main-product.liquid (Under Section) and create a new section called main-product-(collection name).

and pasted this in the top
{% if customer.tags contains ‘Your Customer Tag’ %}

<section id="MainProduct-{{ section.id }}" class="page-width section-{{ section.id }}-padding" data-section="{{ section.id }}"

and this after /section

{% else %}

{% endif %}

No sure if this is all I did , but hopefully it helps.