I used to do a lot of caving. My second cave had a pancake room. 15 ft wide but ceiling height too low to take in a full breath of air. I got halfway across the room (20 ft or so) and started to panic. It was a mental struggle to convince myself that this room had been there for centuries or more without collapsing. I closed my eyes and just relaxed for a few minutes. I calmed down and got across the room no problem. Never had another issue in 10 years of caving, with plenty of tight spaces. I even had to get dug out from the outside once, and was totally comfortable while that happened. It only took about an hour to get dug out.
Another veteran caver (40 years of caving experience, and an electrical lineman as I recall) was 1/4 mile or so inside a cave and just had a panic attack out of nowhere. Not a tough spot or tough cave, but he had been inside caves more than outside for several days, and it just hit him. The other guys in the cave with him got him calmed down enough for him to exit OK. He said that was the only time he ever felt panicky in a cave, and never had another issue after that. He attributed it to being exhausted and just a little too much time underground without a break.
I feel my issue was from lack of experience. My friend's issue was from exhaustion from caving too many long days in a row. Both could apply to issues of unease in trees.