While attempting to replicate a similar bug (for screenshots), that the dragon would die off of the exit portal if you hurt it during its return animation (after being killed).
I killed the dragon whilst it is over the portal and hit it at random. It starting spinning wildly.