How to optimize nodes and view layers created with motion tracking "set scene"
OK I figured out what is going on, the file started with one layer and when I used the camera motion tracking to set the background and tracking scene it created a new layer so Blender rendered both layers, the shadow catching plane was put in a background layer.

the simplified version on top does the same thing as the one with the extra layers , the camera tracking works all the same it just renders faster.