i think you need to change the first assign to something like this:
{%- assign pick_up_availabilities = product.variant.store_availabilities | where: 'pick_up_enabled', true -%}
or
{%- assign pick_up_availabilities = product.selected_or_first_available_variant.store_availabilities | where: 'pick_up_enabled', true -%}
And another suggestion is to set the div below the first condition if you don't have to add other stuff in the div.
like this:
{%- assign pick_up_availabilities = product.variant.store_availabilities | where: 'pick_up_enabled', true -%}
{%- if pick_up_availabilities.size > 0 -%}
<div class="pickup-availability-container">
<span class="h6" style="color:var(--lc-blue);"> STOCKED {% render 'icon_ticked_circle' %}</span>
</div>
{%- endif -%}
Let me know if you've tried the variant and it works,
Thanks, have a great day!
Alessandro