What did you eat before this happened and how long ago?
Some things take longer to digest than others, some foods just sit there for a whole day.
If it looked like coffee grounds, it was probably old blood. Given how much you've been throwing up, might be some kind of esophageal tear (when I had my MW tear it looked like I straight up ate a coffee filter full of instant coffee and had it come right back up) or an ulcer.
ER might just tell you to see a PCP to get referred to a gastro for an endo.