My earlier issue was a problem with jagged edges. I found that if I remove the ID Mask Index: 1 output from the Mix Fac input, the edges are crisp, but the shadow catcher mesh becomes visible, see below.
Requested by Mentalist:
Now I can't figure out how to get the shadowcatcher to be invisible again. Can someone help figure this out?