Combine Masked UDIM Normal and Displace maps?

Hello friends,
I have baked some UDIM Normal and Displace maps that I would like to combine, but I also want to mask off parts of some of them.

I have successfully combined multiple UDIM normal maps by hacking the method outlined by georg240p here:

…and it works great!

At the same time I can successfully mask Normal and Displace maps using this method by Artem Tovbaz:

…it works really well!

My problem happens when I try and combine them with the first method after masking them using the second method. It looks really bad.

It would be really sweet if I could get this to work! Any and all advice is welcome.