Issue solved.
It appears that as I have one product and one subscription, both need to be ID=0. I used 0 and 1 before.
Also it does not read the data reliably so I've had to loop several times to read the inventory information and check I have received it before continuing with my sequence.
It was tricky finding solving issues but seems to work better than the old approach now.