>Basically, gender is encoded in your ID number, and stored in the census database, so people who change gender won't get a new ID number, so there will be a discrepancy between their number and the (correct) database value
You do, in fact, get a new personal identification number when undergoing gender reassignment surgery.
You do, in fact, get a new personal identification number when undergoing gender reassignment surgery.