The reason your shadow can be longer than an object is that the sun is not always overhead. When it’s not overhead, it forms an angle between the object and the ground and we no longer have a simple ’right angle’ situation.
In the diagram below, you can enter the angle of the stick and the sun to see the effect on the shadow. Click the Draw button to change the angle of the stick. Click the Run button to make the sun move across the sky so you can see how the shadow changes.
If, instead of the sun, we have a bar of light above the stick, then we can guarantee that the light will always come from “overhead.” When you move the stick below, notice that the light and the shadow always form a right angle.