I made the opposite mistake once. The oil was too hot and the second I put in the onions, WHOOOSH, giant fireball. It dissipated quickly and there was thankfully no harm. The oil didn't spatter or spill out but it was absolutely a mistake that only had to happen once to learn a lesson.
Wow, that's quite an experience! I wonder what conditions you must have had for the oil to not already be on fire / smoking, but hot enough that a disturbance caused immediate combustion.