I've had similar experiences, at various times throughout my diving. It occasionaly happend when I tried something new (depth/wreck, etc), but as you mentioned, it also reared it's ugly head on dives I'm familair and confortable with.
I can't say what would work for you, but diving through the problem helped me each time. What I mean is, I've been dropping down into a canyon at 90+ feet, a place I may have been the day before, and felt the same need to surface, the water a weight of panic holding me down. My mind shifts at that point, forcing myself to focus on something else, the safety of my buddy, a buoyancy check, a fish I want to photograph, whatever. By moving on to a different activity, I am mentally telling myself that I'm aware of the feeling, but it's a 'non-issue'. I overcome it by redirecting my thoughts towards a specific activity. Within seconds (literally) the fear is gone and the dive resumes.
Truly, if you can't get past the feeling, then doing as suggested, start within a smaller, safer, shallower comfort zone and working back to the original point may be called for. My thought is though, if you can refocus on something else (after all, fear is a thought, if thought is redirected, there is no room for fear, it falls behind and is forgotten), do so and dive through it. If you're anything like me, if you give in to the fear and set the bar a little lower, without working through it, the fear returns at that lower level and you once again have to readjust the bar, lower again.
Acknowledge it at it's inception, recognize it for what it is, an unfounded fear, redirect, refocus and dive. As I said, this may not work for others, it's just what has worked for me on the rare occasion fear tries to take precedence over clear thinking.
John A.