I used to get this "item already exists" error all the time on an XPage application I look after.
From memory it was something to do with the fact that on a new document XPage that has an RTF field, if you save the document and haven't added any content to the RTF field, notes saves it as a Text field, not Rich Text. Then when you come to use it later it would complain that the item already exists.
I added a function that's called as part of the query save code that has stopped this error completely. I'm not saying this is the best way to do it but it works for my application:
var fieldItem:NotesItem = currentDocument.getDocument().getFirstItem("xxxxxx");
if (fieldItem==null){
// create the field as an RTF
writeToLog("Creating xxxxx field");
var rtItem:NotesRichTextItem = currentDocument.getDocument().createRichTextItem("xxxxx");
currentDocument.save();
}else if (fieldItem.getType()==1280){
writeToLog("--> Converting xxxxx to RTF");
currentDocument.replaceItemValue("xxxxxTEXT", fieldItem.getText());
fieldItem.remove();
var rtItem:NotesRichTextItem = currentDocument.getDocument().createRichTextItem("xxxxx");
currentDocument.save();
}
So the system tidies up rich text items on the document when they are in the wrong format (existing documents prior to this fix), and the first time a new document is saved, if there is no text in the RTF field on the XPage, the above code will create a new empty RTF field on the document instead of allowing the server to save the document and create a plain Text field.