Variant inventory quantity always returning 0

New Member
1 0 0

The problem we are facing is that we can not get a meaningful value for variant.inventory_quantity. This page shows that this field is supported on a variant:

The code snippet on the page that does not work as expected is in product-template.liquid:


This is outputted a few lines later and gives the following result :
(It is saved into const newData variable in javascript that can be inspected on a rendered product pages. -> )
So for all variants the quantity is 0 for some reason. Actual quantities are 8, 10, -16. 
In the other store the code builds on this and decides what to show based on the quantity. We would like to use the same approach/code, but can not figure out why the quantity always comes up as 0.
Where may be the reason?
Is there a way to debug this further?