Elysium, given the context you describe your reaction makes perfect sense.
I know what you mean about it being easier to figure out looking back on it. The good thing is, the more you reflect on experiences like this and are able to figure out what happened
after the fact, the easier it will become to address them
as they happen. Those reactions can be very scary... but once you come to understand what causes them they become less frightening. You can get to the point where, at the first sign of that dissociation, you are able to say - hang on a moment, something has been triggered and we need to figure it out before we move on.
So you know... don't knock 'after the fact' learning.

It's part of the process, and it will get you where you want to be eventually!