Shadows of wind movement don't move when using Raytraced shadows

I have some plants with an animated wind effect, so the leaves move in the wind. With Lumen shadows activated, the shadow that the leaves cast also moves as they should. But as soon as I activate raytraced shadows, the animated leaves still move, but the shadows don’t. It’s like the shadow is baked. The shadow only changes if I move the whole tree, but it doesn’t react to the movement of the leaves.