Gabriella, Welcome to the forum. I get heart problems when my reflux is triggered. I have posted quite a bit on the heart's connection to the esophagus on this and the heart forum. You can look up my posts by putting a few "key words" into the box at the top of the page.
As was said by others, the vagus nerve connects the heart and all parts of the digestive system. When you get your stomach or esophagus irritated it can trigger heart arrhythmias. I get rapid heartbeat (tachycardia) when I eat a trigger food (mine happen to contain sulfites). It's called "cardio-esophageal reflex", aka "linked angina." You can google research papers on this.
Most doctors haven't heard of this. I had to work with an allergist who has been in practice a long time and sees it often to find out what was triggering my reaction. It's serious! Once I had a heart attack from it when it went on to become a coronary vasospasm and possibly a plaque rupture in the artery causing a blockage. I have ben to the ER several times, once needing a conversion that "reset" my heart.
Usually I can get my heart to get regular by doing "valsalva maneuvers," like coughing or bearing down like on the toilet. My cardiologist prescribed Atenolol to chew up when I can't get it stopped quickly. If it goes on for an hour I have to go to the ER. Chewing up an aspirin can prevent a clot from forming when this goes on too.