The ER is required to treat everyone, regardless of their ability to pay. But, they are only required to treat and release/stabilize you. If you need follow up treatment or a specialist, then (if) no insurance or money to pay, then No doctor/specialist is required to treat you, even if for instance is dying of cancer.
Now (unless) you need (emergency) surgery when you show up at the ER, then in the majority of most cases, can be scheduled, thus if no insurance or money, then NO surgery is done. In other words, you must be dying when you show up in the ER and if not, then treated and released.
As for bankruptcy, there are chapter 7 and chapter 13. If you don't qualify for a 7, then like most will end up with a chapter 13 which is a (repayment) plan to pay (all) creditors back for 5 years and a judge decides what assets you can keep or must be sold to pay anyone that is owed.
And (yes) in 2019, there is no penalty for not having health insurance.