Can Medicaid cover a bill when you didn’t have Medicaid?

I went to ob for an ultrasound and blood work. They never told me I didn’t have insurance at that time. I then receive information about it and had to give more paper work and finally got it again. I never knew I didn’t have it at that time. Anyways now they told me at ob I have to pay almost half a grand for that appointment. I said I didn’t even know I didnt have it then. I asked if Medicaid could somehow cover it they said no. Now I have it but that bill didn’t get covered because didn’t coverage then BUT I did NOT know. How does this work? Will I have to pay the bill if I didn’t know I didn’t have coverage.

I thought I WAS covered but something temporarily happened with insurance and I wasn’t aware. Only got something in the mail AFTER the appointment.