Not sure if this is a common knowledge, but something l learnt today and decided to share it with you.
When you're adding and removing mask elements, pay attention to the order: Remove elements first, add new second. Otherwise the outcome may not be as expected.
I assumed only the
order of the layer mattered (add had that subtraction as a last item causing it
not to work)

Finally, after debugging the issue found the solution with Remove First -approach.
Illustration about the issue. In my case the 2nd option work as expected
