I am a student of science preparing for the JEE (India). When I normally practice problems, I find no difficulty in thinking straight. Solutions occur to me when I look at a problem, because for the most part, my fundamentals in Physics, Chemistry and Math are clear. But each time I sit down to take a test, I experience some sort of blockage in the mind, as if I'm not paying attention to the question (when actually I am paying attention). I find it harder to work my way around a problem during the exam than I would during practice. Had this difference between practice and exam been little, I probably would have ignored it. But it is so huge that I can feel how drastically it is affecting my score. It just feels like somebody has switched off a valve in my mind, drastically reducing my brainpower. And it's so frustrating to come home from a test and find easy questions that I could have solved, but didn't because their simple solutions didn't occur to me. Is it because of the pressure that comes with a timer going on or could it be something else? And how do I deal with it?
I find that doing strenuous exercise, like an hour-long swim, before an exam relaxes me and calms the nerves.
If you are cramming for the exam, or studying up to the last minute, stop doing that. Let your mind have a chance to settle and integrate your knowledge. Otherwise you are liable to remember only the last thing you looked at.
Also, if you are "studying" by trying to memorize facts, find a different method. You speak of doing "practice problems". That is usually better than reading the book or memorizing.
But longer term, if you take good notes, you can also "study" by going through them and summarizing them in a smaller space, reducing 10 pages to 1, or to a few note cards. You are more likely to recall what you wrote than what you read.
Along with the previous good advice:
I would try "easing into problems" by rewriting the question within your answer space. Often doing this gets your subconscious engaged a bit in the problem and it decreases the anxiety versus having to immediately spit out an algorithm.
Do more practice. I know this sounds counterintuitive since you say 'I'm fine on practice, but not performance', but (a) even if this is true, "overdoing" the practice may compensate for your blanking and (b) it is INCREDIBLY common for students to say they do enough practice, but really...THEY DON'T. An easy thing to do is to work 100% of the text's drill problems versus just the assigned ones. [One sneaky benefit is that teachers often use unassigned problems or at least the methods or tricks in unassigned problems on test questions.]
Use your practice/homework to somewhat mimic exam conditions. Work the problems expeditiously (not frantic, but also not slow). Be very strict about working all the sections problems, then checking the answers (not one by one, but whole section.) If you do not have access to full answers, then try to purchase an answer book or at least go to office hours to use the instructors solution guide. Try NOT to look back for formulas or methods but after reading the section, write down a small "cheat sheet" of formulas/methods, memorize that and then set it aside, and then work the problems, closed book. If you miss ANY problem for a conceptual reason OR a "dumb mistake", force yourself to work the entire problem over again, closed book. That is the "punishment" for getting it wrong.
P.s. Other study habits: read the section and work the drill problems BEFORE the lecture. The lecture then becomes review. Make sure you work every example problem as you read the text. You may think this is inefficient time-wise, but I find that you end up saving time "on the back end". In addition, you will master the subject much more strongly than if you rely on lecture as your initial learning tool and use the text as a reference. In any case, you are not doing well and need to compensate. So going a little overboard is worth it. (But I actually still, paradoxically, don't think it is time inefficent...mastery learning ends up being way better use of your time.)