Grazzt
Demon Lord
Instead of being shunted or pushed aside and taking no damage, you could say the shapechanging/polymorphing creature to take 1d8 points of damage per size difference when attempting to change inside a confined space (i.e. changing from Fine to Huge is six size differences so the character would take 6d8 points of damage).
Although- I think your ruling worked fine.
Although- I think your ruling worked fine.