check box with dynamic content and error with submit handler
Make sure you understand the processing flow of drupal forms. See an illustration here for example: https://www.drupal.org/node/165104

The basic flow is like this:


First request

Form build to represent the form to the user
User hits submit which results in a new request to the server

Second request

Form gets rebuild by calling the form builder (basket_form)
Form gets processed (validate and submit handlers are called)



The error message that you see results from the fact, that after the user hits the submit button, the form is first rebuild. Because you are using the $_SESSION to store your values (you should use the $form_state['values'] array instead) the checkboxes will not be build. And when drupal processes the form after the internal rebuild, it recognizes, that form items have been submitted that are not part of the form.

Also this might help: http://proofgroup.com/blog/2008/jul/debugging_mysterious_illegal_choice_has_been_detected_please_contact_site_administrato