yep, it happens. and more to the point it will happen. I am not going to say much about the tech diving part, TSandM already commented. but two things for all SCUBA diving practices that I have learned are..
This is an equipment intensive sport. Likely the most equipment intensive sport or activity that most of us are involved in. And in addition to this it is a sport (hobby, activity, what ever) where a huge amount of risk can be mitigated in advance. So no matter what kind of Dive you are embarking on you should be very very familiar with your equipment and how it is set up. and then check to see that it is done so.
Panic, it seams that what you described was a situation where you started to panic and then reigned it back in. That ability is the difference. Maybe in your case the panic got under control beacouse of the situation resolving it's self (you discovering the errant octo, or catching up with your buddy, I was not clear on what was the direct source of your panic there, the hanging octo or turning to see your buddy way ahead of you. Either way what is important is that you know.) or maybe you took control of that panic and then the situation resolved it's self. Either way remember that feeling, remember how it felt when this problem was nagging at you and as it crept up to take control. Of course this sometimes happens real fast but the memory is there none the less. use it and learn from it. Obviously we strive to avoid any panic by controlling the situation as tightly as possible. The more extreme the Dive the more anal we get about every nit-picking little detail, and rightfully so. But in the end you would be hard pressed to find a very experienced diver whom hasn't felt that anxiety and panic rising and had to stomp it back down and take back control. Extreme diving is just one of those places that fight or flight responses do not help us, it is not like running from bears where that panicky run can get you out of trouble fast, quite the oppisite.
I do actually want to support the idea of getting some training and setting up your gear for technical dives, I think this is smart but at the same time I realize that we all push in a bit more than we should in the beginning, I know I did. Either way TSandM has a good point and it should be considered. (Incidentally I haven't updated my profile on here since I first set the account up so I am not sure what it says
Now I am not picking on you luckikmc just trying to add some details for those less experienced divers that may be lurking out there. I would say you did good. you panicked but you got it back you got out of there and you know what you did wrong to avoid it next time.