there's a possibility that it could just be purely psychological. This happens to me sometimes, not to the extremes that you described it, but sometimes I feel like my heart rate increases also and it always makes me nervous.

You just have to remind yourself that it's impossible to die on just weed (see: Annual Causes of Death in the United States | Drug War Facts), and that you'll be fine. All you gotta do is try to relax, and make sure you're in a situation where you'll feel comfortable.

I'd say that next time you smoke, just smoke the minimum. Most people underestimate how effective just one or two hits could be. Give it a few minutes to soak in, and you'll definitely feel it... but not too much that you'll be on the bathroom floor.

hope that helped