What you were expecting to happen, and what actually happened?
When a troop dies, it shouldn’t still be able to cast its spell.
What are the steps to make it happen again?
Fill a troop on the brink of death. Bring up its cast screen during the AI’s turn and then though it dies. You’ll still be able to cast.
Do you have any screenshots or video you want to share with us so we can see the problem? Attach them to your post!