Twenty-seven Chinese officials have been penalised for the wrongful execution of a teenager, state news agency Xinhua says.