Seems like a process problem for Apple regarding trade ins. Clearly they got a trade in for something, refurbed it, and somewhere along the way it got marked as stolen. I assume Apple should have access to the same database carriers have to confirm whether something is on the IMEI blacklist.
I think being on support for 3 hours without them doing anything is the bigger issue. You’re entitled to a working replacement, you should be able to get a working replacement without putting in unreasonable effort.
(That said, I’m going through a similar-ish issue right now with a pair of AirPods where I’m 90% sure Amazon, not Apple, is in the wrong, but considering Apple’s size and vast wealth, I’m kinda surprised they’re making me resolve my issue with Amazon rather than just sending me the version of AirPods Amazon was supposed to.)