SERVER-9063 Correct type of return value in buildStages error case