The compositor node setup shown in the screenshot works with a simple test scene in which light is provided by the World Background and the render layer delivers a shadow pass. The result is acceptable in the test- but in a scene with a lot of mesh geometry, the same setup delivers a completely black image. Is this caused by some limitation of computing capacity- can there be too much geometry in a scene, or can lighting be too complicated, for Cycles to deliver a separate shadow pass?
Select the object you want to use the shadow data,go to the object settings tab,scroll down and enable the Shadow Catcher. Then,if you want it to overlay it on another scene,make a second Render Layer and select the scenes you want to use by pressing shift+LMB. Go to compositing and add an Alpha Over node and two RenderLayer nodes. Plug the first layer's Alpha channel into the Alpha channel of the Alpha Over node,plug its color into the bottom socket and the second layer's color into the top color socket.
In the scene the objects both cast and receive shadows, so I copied all the objects onto a separate layer that is visible during the rendering but not active in the output of the rendering. Thus the rendering reproduces only objects with Shadow Catcher activated.