I've never had one hatch and still be attached to the egg. I would think it was either hatched prematurely or had a birth defect or major hernia. I don't think there was much else you could have done. Sorry for your loss
You could do it better with what your using as media in your cup and would not have to spray or with and incubator. But I don't think it would have had any different outcome. This seems to be freak accident and not something you did wrong. Better luck on the next one.