I'm not including a turn file because this bug is very easy to replicate and always happens i could include a file if it becomes requested...
jotun skratti from early era or late era monster553 ... recruit one and get ready to send it into a battle that it will win (maybe it will need an army with it)
script him to cast a spell then change shape then attack
watch the battle he will cast the spell change shape ONCE and then attack... at the end of the battle he will still be in his second form... now stop watching the battle and check the main map he is now in his third form for no reason!
this makes it impossible to use this script while holding items even though this should be completely possible there is no reason for the change shape to happen again randomly
We might have to debate your use of the word "randomly". I'm under the impression that this is a known issue, and the fact that you know easily how to reproduce it - sort of contradicts the concept of "random".
It is a known issue and it is unfortunate. My first encounter with the lovable Argitoth was him telling me how much I suck because I told him not to shapechange in battle. I miss that guy, the forums just haven't been as hilarious without him.