Movable Direct Light on Masked material bug

Hello,

Im having an issue with a material ive made - it is a masked material which uses a world located sphere to control the opacity. However Im finding it is leaving behind the shadows when this sphere is moved. If I move the camera far enough away and back again it updates the shadows to look correct, but then moving the sphere breaks it again.

scale6

Does anyone have any idea what causes this? is it a bug? Iv tried all the settings on the direct light and none seem to have an effect

Its on UE5.0.2

EDIT:

So ive found the only setting which seems to have any effect on this

Another edit, ive found that the console command

r.Shadow.Virtual.Cache 0

fixes this. Although it reduces FPS by about 10-15

Indeed. Virtual Shadow Maps use caching to improve performance for static objects. It is divided into a grid and the engine checks for certain things to decide if the page should be invalidated (which is why it sometimes fixes itself). Disabling the cache entirely is extremely expensive because then all shadows need to be recalculated per frame, but there are experimental features described in your linked page that can help so pay special attention to the sections about the cache and foliage.
If those do not help, VSMs may not be a good fit for your project in its current form but it is still in it’s early days.