Landscape Sample not working in Material Attribute Layers

I’m having a hard time using the Landscape Sample as an Alpha mask in Material Attribute Layers, as in when I do it, it fills the Landscape section that the Sample refers to instead of the actual painting.

I’ll elaborate:
I’m trying to use only the Material Attribute Layer node to create my Landscape material because it is dynamic, convenient and efficient, but I still need the ability to paint the Landscape to show other materials so I set up the Landscape and the Layer Blend node.

Then I created a Material Layer Blend and I connected the Landscape Sample (the Landscape layers are already created with Weight-Blend) to the BlendMaterialAttributes node so that, when I paint on the Landscape, it should blend the Material Layers I placed in the stack.

The problem is that, when I do that, it paints a whole section of the Landscape instead of what I painted.

To experiment, I tried the same procedure but this time I blended the Material Attribute Layers node and a Material Layer using the same Material Layer Blend.

And this time it works correctly (well, the Material Layer Blend is still acting up in between the layers, but the picture shows how the same Material Layer Blend is workin correctly on the Material Layer.)

So, why it does work between Material Attribute Layer and a Material Layer BUT it doesn’t work between layers in the Material Attribute Layer? What am I doing wrong? It’s driving me nuts.

I found a video that explains how this material system should be made. The video is by UNDINI at this link 4: Materials Layers - Next-Gen Landscape Material in Unreal - YouTube . It’s really well made.
In summary, the problem is that the Material Layer Blend isn’t able to get the Landscape sample without declaring it in the actual Material, so a workaround is used that lets the Material Layer Stack carry the Sample information using the Custom UVs channel.

The Material is laid out like so:

Then the Sample informations are carried by the Material Layer like this:

And get used in the Material Layer Blend here (in my setup I added a component mask parameter that lets me choose which channel and so which sample to feed to the alpha)

And that’s it