I know it's probably too late, but I still don't understand it, sorry. It's probably because of my lack of experience with masks and compositing.
Here is my issue:
As I understand it, from looking at your images, you would like to render a green mask of the "background" and a red mask of the "bird":
The thing is that you already have such mask:
Why not just use it and, for example, color the black parts green and color the white parts red?
I am 100% sure I am missing something, but I would love to understand what.
Maybe explaining what kind of results you would like to get would make it easier? What the end result should look like?