How to use form API to edit sub form that is added to user_register_form
You probably forgot to reference the $form variable ("&amp;$form").
The alternative to #after_build would be #pre_render, which misses $form_state but should generally be preferred for changes that only affect the rendering of a form.