The near one you got spot on.
The further and more broken up one I can see that the intersections between the ground lines and the light rays got a bit confused and led to the shadow being distorted. It is quite hard to keep track of all of the intersections when there are so many to check and they are all close to in line with each other.
I marked the lines over your image and left all construction lines you drew in place to show where things were confusing.
The right broken side of the object (from our point of view) can be ignored because its points fall within the overall shadow and hence we wont see them.
I separated the colors of the shadow line and the light rays into sets for the remaining 3 corners and labeled the intersection points. I find it really clears things up and reduces confusion to first draw the ground shadow direction line, and then draw the light ray line coming down and stop the light line right at the intersection with the shadow line. All the right lines were there you just flipped some of the vertex points.
I am always happy to check this stuff, it gets my math brain working a bit harder, a good break from creativity to just focus on hard reality stuff.