If the instructor did not adequately prepare you for that drill, then you should not feel ashamed. If I was asked to do that and couldn't, then I would certainly feel ashamed but that is a drill that we teach at the advanced open water level to our students *university program where they get 3hrs/week of in-water time for 16 weeks but they are trained to do it with small skills leading up to a full equipment ditch and don.
If the instructions to the instructor were "go fetch" then shame on him for setting the class up for failure with the drill. If he chucked everything in and advised you on how to approach the skill and you still panicked, then still shame on him because it's open water and he didn't prepare you enough for that drill. Setting students up for failure is at best rude, but wrong on so many more levels.
Shake it
@Jfinch and learn from the experience. It slapped you in the face but gave you a healthy respect for what's going on in the water and now you can process why that happened and what you need to do to mitigate the risk of it happening again, if you need help with going through that, some of us are quite good at it and are more than happy to help guide you.
Where in the UK are you? I'll be in Leeds Wednesday-Saturday if you are anywhere close to there and want to grab a pint to go through it