Why is the 'size unavailable' not displaying correctly for some products?

Ive noticed that only some of the products wouldnt correctly show “size unavailable”. See examples below:

Correct show:

As you can see, size option buttons are grey and inactive, as well as Add to Cart button changes and literally says Sold Out.

However, on some products it does not work as intended:

Even tho this size is out of stock, size option button is still active and won`t turn grey.

Took me a while to realise WHY this is happening - if there is a colour switch on a product, then size button won`t be showing properly (available / out of stock), but if there is no colour switch, then size button works as intended.

Please help to amend the code. I tried to the best of my knowledge, but no success.

```> > I do understand there should be is_size assigned, yet I could not figure it on my own.> > Thank you in advance.

Hi @kgbfashionista

Thank you for your question.
Please send your site and if your site is password protected, please send me the password. I will check it.

Hi,

The website is: youknowwhos.co.uk

No password required.

To help you out, here is a product with correct sizes:

https://youknowwhos.co.uk/collections/new-in/products/ladies-sisterhood-t-shirt-white?variant=44318871257258

Here is a product where sizes are showing incorrectly:

https://youknowwhos.co.uk/collections/december/products/copy-of-ladies-spiral-printed-top?variant=44133376721066