You said the dragon is invincible unless it is not flying. That would mean it can only be damaged if it is on the ground.
But then you agreed with ParthianShotX that what you indicated was it can be damaged while flying in zone 5. Which is not at all what you said originally.
What you said is not what you meant, is what I am getting at. Sorry. I was just trying to explain why I interpreted your post the way I did, not be disrespectful.
All good. I was actually agreeing with the comment from ParthianShotX that it is invincible before wave 5 (whether flying or not).
Script wise the dragon 'should' only be susceptible to damage from players when it is on the ground in zone 5.
However, I will concede that there are likely edge cases where damage can be applied through things like DOT effects. The take off and landing actions might also allow some small windows where visually the dragon is airborne, but as far as the logic is concerned it is still "on the ground".
No disrespect taken

I am currently on a beach with really bad network so I apologize for any shortness in responses.