Getting attacked when it fails as a ghost is by design?
You cast the spell, you roll the dice, and you take your chances.