I have the same issue... although I did not try unlock.
I Jailbroke my iPhone 3GS on 3.1.2. with BlackRa1n RC3 and all was well for a couple of days. All of a sudden, I picked the phone up and it wanted to activate.?. If I run recovery in both normal and DFU modes, I get error 23. I have no IMEI or ICCID is unknown and no amount of trying gets past err 23.
I have read many posts and all say it is hardware - but i'm not convinced.
But for now.. 3GS = BRICK!