'Ex-secretary' error. See ex- , sub-secretary.
The one who leaves the post of undersecretary is called a former undersecretary. The ex- prefix is used when someone has been something but has ceased to be.