If you're going into surgery you generally get both an anesthetic (to make you unconscious) as well as a paralytic (which does nothing to decrease your sensation, awareness or pain). The paralytic just blocks transmission of the neurons to the muscles, it allows them to intubate you and use more pain and anesthetic medications without worrying about losing your airway or stopping breathing.

This study mentions a lot of people waking up "before or after surgeries", which to me just suggests the anesthetic wore off before the paralytic. Certainly traumatic and unpleasant, but in most cases it ought to be pretty brief.

There have been cases where the IV line administering the anesthetic becomes dislodged or (worst case) was never connected in the first place. If a line is kinked the anesthesiologist's machines will alert him to that fact. If it's just spitting out vecuronium onto the bed, no one notices because the patient is covered in piles of opaque sterile drapes to keep the field clean. So in very rare cases the patient might be completely conscious for the entire event, able to feel everything, but unable to move...

That probably doesn't happen 300 times per year, but it certainly does happen, and would be much, much worse than the brief sensation of not being able to move when anesthesia gets too light for a few minutes.

I heard second or third hand about a case where the anesthetist forgot to hook up the anesthetic agent. The patient was able to repeat in great detail the conversation the surgeons were having while they were in the middle of the operation...