I’m not a medical doctor, I just have a Bachelors of Science in Science. I had a similar issue and it turned out to be due to my pacemaker cells arguing with each other about who should be first to trigger a heart beat. When they were fighting, blood pressure would drop and heart beats were skipped. This definitely will impact your 5K run times.
Get checked out by a cardiologist or a cardio electrophysiologist. They can monitor your rhythm with a wearable monitor or try to trigger it with a stress test. The treatment could be; do nothing, meds, ablation or a pacemaker.
Getting it fixed should be high on your todo list. Don’t wait for the heart to slow or stop for more then a few seconds.