Edge Mask Issue - Render nodes I'm getting this weird edge when trying to use a mask in my composite, is there any way to get rid of this?

Here is the issue:

Here is my render node setup:

Here is my render layer setup:

The shadow pass and combined pass:


Any help or support would be greatly appreciated, thank you in advance!
Solution:

Put your shadow element over white background and then multiply the colored layer with it. You get dark edge because you have punched a hole into shadow element with your character and thus the pixel values on transparent edges are darker than they should be. But if you merge over white first, edge color gradient is towards white which in multiply op does not change the brightness.

But overall I think your node setup is a bit confusing, you are using alpha as mix factor while to get shadows balanced you should simply multiply shadow element with color and drive the mix with single value. And if you want more control, use gamma etc color correction operation on shadow element, not blending factor.