It sounds to me as though the phone is barred. As if someone has sold it to Cex and then reported it stolen or lost in order to obtain another through some sort of insurance policy. It's for this reason that you wouldn't catch me buying a second hand phone unless I knew and trusted the seller.
Even if it's not barred it's a fault that'd be extremely difficult to cause yourself and as this has happened within their own 30 day "warranty" period they're absolutely obliged to replace or refund you. But you already knew that. Keep fighting.