Oh yes, after add my.cast=on in dynamic light action the entity cast shadow within the dynamic light range.
But why the entity still cast shadow when not in dynamic light range, is that the nature of sun light, if no other dynamic light the sun light will active, or the "sun_light = off" not work.