I know that switching pronouns when referring to the same subject mid-sentence is considered grammatically incorrect, as in,
It is very easy for one to open a program in our newest operating system, all you have to do is click the corresponding icon.
where the pronoun referring to the subject changes from "one" to "you".
Are there any situations where it is appropriate to switch? For example, should the sentence,
If it is a boy, name him Moses; if it is a girl, name her Zipporah.
be rephrased like this or not?
If it is a boy, name it Moses; if it is a girl, name it Zipporah.