See here[1] for a pretty good explanation. Importantly, your insurer treating the visit as in-network does not force the provider to treat it as in-network; surprise bills come from the provider, not the insurer. From that post:
If the insurer pays less than the out-of-network emergency room bills, the emergency room can send you a balance bill for the difference, over and above the deductible and coinsurance amounts you pay.
That “if” condition is usually going to hold, so a lot of surprise bills come out even despite the ACA rule.
[1] https://www.verywellhealth.com/get-in-network-rates-out-of-n...