Check the list_id of the form as well. Otherwise the groups will not be displayed when there is a form validation error.