2 material function (instances or not) in material node both show with same texture parameter in preview

So created material function with parameters, including texture parameters:

I made two instances of the same material function and placed them in empty material for clarity purposes.

First one looks like this:

Second one looks like this:

But when I plug them in my test material they both look like the first one:

If I remove one of them, the other one starts to work correctly, but together they only show whichever was added to graph first. Like if I remove first grass/rocks, second one start to show correct red roof material and if I add grass/rock material again, they both show up as grass/rocks.

I tried using separate material functions instead of instances, but results are similarly buggy.

What’s going on here?
How do I get it to work properly?

Hello! I think that main problem is same parameter name. It seemed that this parameter is get from first node to global parameter list and after that the second parameter from second node is ignored because its name is already contained in global param list…

Yeah, you’re absolutely right, just messed around with it and figured it out not long after I posted the question

So as Kehel18 put it the problem was in the same parameter names from material functions that were exposed to the final material.

I can be solved by creating separate functions for each layer without parameters or using separate parameters for each layer in final material instance.