As promised what feels half a century ago, I now have the correct and working template for creating Unity3D URP/HDRP Terrain Layers, with Diffuse, Normal and Mask Map.

Substance Graph
Of course this is only the rough template. It also just converts the inverted graymap from the input bitmap node for smoothness (0=rough, 1=smooth) and sets metal to 0 (no metal). You will have to change that depending of the type of terrain layer you create. (obvious, but I thought I just say it).
But the mask generation is now 100% working, I tested it thoroughly.