Yes, the problem is most likely lack of oxygen.
After a heavy weight training set ATP and glycogen are depleted. Oxygen is required to replenish both ATP, glycogen and PC (phosphocreatine) which is a major contributor to momentary muscular failure. To meet these requirements the body need more oxygen, so you breath heavier. If this isn't enough (squats are very damanding), the body will use more of the oxygen to replenish ATP, PC and glycogen so other areas of you body will suffer. This will cause a dizzy/lightheaded feeling.
If the activity that the muscles were doing generated a lot of lactic acid (anaerobic glycolysis mechanism) - such as intense weight training in the 12 rep and above range - then light activity of the muscles during the replenishment period may actually be of benefit. This is because some of the lactic acid would be used to fuel the light activity and, hence, the activity would help clear lactic acid from the muscle. Care must be taken, though, to ensure that this light activity is not intense enough to require the use of the phosphagen or anaerobic glycolysis mechanisms for energy - this would deplete ATP as warned of above.