Thanks Paul.
JCE does appear to be working ok. I've traced the problem to the eDocman editor plugin inside JCE, which throws the error:
Uncaught TypeError: Cannot read properties of undefined (reading 'replaceSelection')
at window.jSelectEdocmanView (admin-documents-modal.js:41:56)
at HTMLAnchorElement.<anonymous> (admin-documents-modal.js:60:37)
The problem code appears to be around:
var editor = Joomla.getOptions('EDEditor');
var tag = '<a class=\"edocmanxtdlink\" href='+'\"index.php?option=com_edocman&task=document.viewdoc&id='+id+ '&Item
id=' + itemid + '\">'+title+'</a>';
window.parent.Joomla.editors.instances[editor].replaceSelection(tag);
This is as far as my knowledge goes on this. I'll reach out to the eDocman developer and see what he says.
This all worked ok in the back end, so I'm suspecting it might be something related to frontend editing.
Cheers...Vince