Here is the sequence of events that can lead to "phantom" titles becoming associated with pubs:
1. Editor creates a "Merge Title" submission for a title in a pub (or for multiple titles, as was the case here)
2. Editor creates an "Import Contents" submission using the pub above as the source (steps 1 and 2 can occur in any order)
3. Moderator approves the first submission. As luck would have it, the title record used above is deleted and the other title (from a different pub) is retained.
4. Moderator approves the second submission. The import logic doesn't check whether the title record still exists, so it lets the moderator approve the submission.
After these manipulations the pub has a "phantom" title associated with it, hence the red error that you get when you try to remove titles from the pub. In order to prevent this from happening in the future we need to add a check to the moderator approval page for the import/export/clone logic, mod/cv_new.py. The check will simply reject submissions that use non-existing title records. We also need a cleanup script that will delete these phantom records from the "pub_content" table.
Anonymous
A similar problem existed when a "clone pub" submission was approved after the original pub's reference titles was deleted. Both problems were fixed in mod/cv_new.py 1.9, installed in r2012-10.