There are two common reasons for that.
This can happen if the iPhone was purchased from someone who had stolen or acquired the iPhone illegally. This has been mentioned in the news a couple of times in the past where an entire shipment of devices was stolen. But, Apple knows all of the serial numbers for those devices and flags them as such. Then you see issues like this.
Another possible reason why the serial number isn't valid is because your iPhone may have had an issue (previous owner) and they received a replacement iPhone. After that, the previous owner is required to return the older phone to Apple, but sold it instead.
In this case, China was the worst possible country to purchase a used phone from. Many stolen phones end up in Shenzhen, China, where they are disassembled for parts. They also use equipment that is sometimes capable of resetting any lock on the device. I've seen a video of how this is done. It's not even slightly easy and requires some specialized, expensive hardware to do it. If they can get the phone "working" as new, it's sold to unsuspecting buyers.
Yours was reported and flagged.
- Hence the inactive serial number.
- It may have been a phone that was supposed to be returned as a warranty replacement, but never was. So its serial number was invalidated. But being in China, far more likely a stolen and stripped phone.
- No.
- It absolutely won't have a warranty.
The IMEI is simply a hardware identifier for wireless access. Every single device that can access the internet or a cellular service has a unique IMEI number so it is the only device that will respond to that number. The system wouldn't work if multiple phones had the same IMEI. They'd all ring to the same incoming call.