Seems like most of the theme functions which takes both #id and #attributes, can generate duplicate id's on the output item.
Since they both write out $element[#id] and drupal_attributes($element[#attributes]);
One of them should have higher priority and overwrtite the other value in the presence of both them.
Comments
Comment #1
pasqualle#111719: FAPI fails to check auto-generated IDs for uniqueness - XHTML validation fails.