This isn't a criticism of you, I don't know your full story. But I think many people have a misconception of the role of an ER. I know an ER doctor well, and the role of an ER is to, in approximate order of priority:
1. Prevent someone from dying
2. Treat severe injuries
3. Identify if what someone is experiencing is life-threatening or requires immediate treatment to prevent their condition worsening
4. Provide basic treatment and relief for a condition which is determined not to be an imminent threat
In particular, they are not for diagnosing chronic conditions. If an ER determines that someone's stomach pain is not an imminent, severe threat to their health, then they are sending them out of the ER with medication for short-term relief in order to make room for people who are having an emergency. The ER doc I know gets very annoyed at recurring patients who expect the ER to help them diagnose and treat their illness. If you go the ER, they send you home, and the thing happens again, make an appointment with a physician (and also go to the ER if you think it's serious).
Unfortunately, the medical system is very confusing and difficult to navigate. This is a big part of why so many people end up at ERs who should be making appointments with non-emergency doctors - finding a doctor and making appointments is often hard and stressful, while an ER will look at anyone who walks through the doors.
Where I live there is a lack of family doctors.