Some people don't like their original given name, so that might account for some switches.
But you also need to take in to account how census data was compiled. In the UK, the householder filled out the original 'Household Schedule' form, in handwriting of varying degrees of readability. This was then transcribed at a central point on to another form, the enumeration book, which is the form available to us now. This is why they appear relatively neat, and all in the same handwriting.
So, if the householder wrote 'Jos' (for Joseph) un-clearly, this might have been mis-transcribed as 'John' later.
I have come across mistakes in my own tree such as a man named James mis-recorded as Thomas. Exactly how that came about shall forever be a mystery.
So understanding an error may depend on things like in which country the census was taken in, or which year. It is worth understanding the methodology of data collection for whichever record you are contemplating.