I believe Oswald was told to establish his alibi by staying inside that 2nd Floor Lunchroom. The plan was to "pop" him inside the Lunchroom and make it look like a suicide. DPD Officer Baker beat the assassin to that lunchroom. After being confronted by Baker, Oswald got to thinking he was a sitting duck, possibly being setup, and he then left the TSBD and got his gun. At that point, Oswald was in scramble mode. No Plan.
What gun would he have "popped" himself with in the lunchroom? As an admitted amateur at assassination planning, I would have placed the Carcano under his chin and blown his head off right there in the sniper's nest. Now
there is a plausible "suicide."
The problem with the "panic" explanation for Oswald's post-assassination actions is that it's completely ad hoc. You posit "panic" because you're stuck with his actions. You have a very difficult time explaining why he would've panicked unless he'd known his rifle was in the TSBD. You have a very difficult time explaining why, with his rifle in the TSBD and the Presidential motorcade going by, he would have failed to put 2+2 together and would have agreed to placidly wait in the lunchroom. If he didn't know his rifle was in the TSBD, of course, panic makes no sense. If he did know but was completely innocent, heading for the nearest policeman and cooperating fully seems more plausible to me than what he actually did. On top of all that, why would the Oswald who was cool as a cucumber in the lunchroom encounter and mystifyingly cool under interrogation have "panicked" when you say he did?