"His selection as headmaster surprised us" could be interpreted as "[The person that he chose] as headmaster surprised us." It's ok if there is no ambiguity in the context, though.
The clearest option is to make it active voice: "We were surprised that he was chosen as a headmaster."
“His being chosen” vs. “His having been chosen”
"His selection as headmaster surprised us" could be interpreted as "[The person that he chose] as headmaster surprised us." It's ok if there is no ambiguity in the context, though.
The clearest option is to make it active voice: "We were surprised that he was chosen as a headmaster."