Shadowcaster2d making incorrect shadow shapes. How can I fix it?

Using shadowcaster2d in URP: (2022.2.4f1)

I build 2d walls at runtime of various dimensions, so they are basically textured quads. I add a light2d to the scene and shadowcaster2d to the walls, but the shadows created arent the same shape as the walls; they are slightly fatter, meaning the shadows leave gaps. Some shadowcasters are randomly at 90 degrees to the wall (looking at the shadowcaster points in the inspector, they look like the wall, turned 90 degrees). I can manually adjust the shadows at runtime using the shape button, and that fixes the error, so for some reason the shadowcaster is not finding the correct object shape. (my colliders and other attached features on the wall are in the correct position). I see some threads from a decade ago about workarounds to set the shadpcaster2d shapepath from the collider path. I’ve tried having shadowcast added to the prefab as a component, and Ive tried adding at runtime…same result. Is there yet any better way to do this? I see the shapePath property is still read only. (Or am I just making a rookie mistake somewhere?) Many thanks, once again.

So, a bit of a bump. Still struggling with this. Shadowcast just doesnt seem to cope with meshes generated at runtime. The shadowcaster needs to be added as a component in code. If it exists before the mesh is generated, shadowcaster2d does not update its mesh and has zero size. If added after mesh generation, it seems to have the mesh shape and orientation before any manipulation (rotation etc), and cannot be updated to reflect changes in any way. I may be wrong. There are threads from a couple of years ago from unity developers mentioning updates coming for 2d shadows to address shadow problems, but Im not sure if that has happened yet.