I'm on the second case (carrier unlock), so It'd be great if you have an answer for that. In my case my phone was unlocked for a long time and after installing some roms it got locked again, really not sure why. I got back to my original rom but it's still locked, for which I googled it seems...