How can a factory sealed iPhone have a bad ESN?

I've noticed on eBay some factory sealed iPhones with bad ESN numbers. From what I gather, a phone gets a bad ESN when it is reported stolen/lost or the owner owes money to their service provider. How can a factory sealed iPhone have a bad ESN?

The phone could have been stolen before being opened/used.

The phone is a fake/knockoff.

Don't buy them

The sealed phones were stolen.