Sorry you had a scary experience, but I don't think you were in any real danger. One of the things electrical appliance designers have to deal with is how to keep the product safe even when something breaks.
It sounds to me like like a wire or other connection broke loose during shipping. Unfortunately that happens sometimes, even to the best of products, which is why you need to pay attention to warranty and defective/return details when making a purchase. It's also why I say to never throw away the box or any packing materials until you have used the machine for a while and are quite sure everything works correctly.
I assume the company you got it from is dependable and will replace it for you without any hassle. Contact them right away and tell them what happened.
Love, love, love,
- Shivananda Deva