ok. so, i managed to get this working. i was missing the step “configure the function” in the shopify function lifecycle mentioned here: https://shopify.dev/api/functions#lifecycle-of-a-shopify-function
this was an extra step for my use-case that i did not think i needed, since i had understood that a shopify function is meant to return the discount nodes applicable to the cart and the configuration to provide the function as input is coming from my api backend without the need for the merchant to do any “configuration”.
currently still testing the functionality, but everything seems to work as documented now.