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.