In a standard page load, each form that is built calls drupal_html_id() to get an unique form id across the entire page load. However, in the case of the IPE, there is a fair bit of form rebuilding that does not require a page load. As a result, a situation arises where a single form on the page (for example, #search-form) begins to change its ID each time the IPE is invoked (becoming #search-form--2 and then #search-form--3 and so on). This breaks various CSS assumptions (i.e. Bartik's theming of #search-form) and plenty of JS targeting.
This patch resets the $_POST['ajax_html_ids'] array upon saving the IPE which solves the problem of duplicate IDs since when drupal_html_id() inspects it upon rebuilding it can correctly generate the right and assumed ID. I am not sure if this is the right way to invalidate this, but wanted to open an issue with a patch to consider resolutions.