Hi, I have the same problem, but not only with foliage.
I was looking for a solution to this problem and found the reason, it might be a UE5 bug, but if you switch the Skylight actor mode to Stationary, the problem should go away.
UE5 dynamically generates ambience because of this the shadows flicker. I submitted a report with this problem on the Unreal engine website