OP: nothing to feel bad about. You are in an environment your body isn't build for, your brain can't truly comprehend you are actually there and you are doing it for fun.
Although I do not know you, I am going to guess you didn't go trough astronaut school or any other serious stress inducing training program, so it is absolutely no issue if the alien, hostile environment you are playing in while using life support system can be a bit overwhelming. Most divers will have an experience like this at some point.
Whatever causes you to panic (I agree this could have been CO2 buildup, but might be something else altogether. In my early dive days I had a freeflowing reg that triggered a bit of panic), the best way to deal with it is to remain / regain you calm. Stop what you are doing, breathe deep and slow, think about your situation and only once you determined what you want to do do it. If this means giving the thumbs up, congratulate yourself at the surface for making a safe decision and dive another day.
Use the experience to visualize what you would do if it would happen again. Even if you are deeper, (AOWD is 30 meter max) the response stays the same: relax, take it from there. If you want to abort a dive, you abort the dive. If you want to catch your breath for a few minutes and then reevaluate the situation, do that.
Regarding your question if a different reg would make a difference; yes it might, but in reality, assuming the reg is well maintained, it is more likely either physiology (like CO2 buildup) or psychologically (like "what am I doing here this doesn't feel right") that causes the onset of panic. If buying a brand new shiny reg puts your mind at ease, do it. It is a hobby after all. " because it is shiny" is a perfect reason to buy toys
Just keep doing what you are doing: slowly build on your experience, talk with other divers about it and remain conservative. Last but not least: 10 mega bonus points for going back in the water shortly after; glad to see you are still enjoying our favorite sport
