IF - and that’s a big if - RTs are broken, then make 2 RTs.
Set one to have a green background - or any color that’s definitely not on the character.
PRIMARY colors, so that you can pull the white/black off the single channel.
Then you subtract the Green (or other) channel from the full render target - or use it as the opacity mask.
Now, my thinking here is that the Alpha node is already the way it ought to be to plug into the opacity mask as is.
Afterall, A stands for Alpha. Why did the opacity mask need to be inverted in the first place for the UIMat node?
You can check on this by just previewing the 1-x node.