There's one more tiny thing with the 4.0 code for RSS -- the JROUTE statement:
$rss_item->link =
JRoute::_("index.php?option=com_content&task=view&id=$contentid#JOSC" . $item['id']);
Is failing because if there are no comments yet, there is no itemid, so the #JOSC has no anchor. So that leads to a 404 and it's not possible to subscribe to the feed until a comment exists in it. Changing it to:
index.php?option=com_content&task=view&id=$contentid#" . $item['id']);
works because then the trailing hashmark defaults to the top of the file, and the browser can still open the link.
There is another problem but it's a Joomla problem. Joomla sef thinks an 'rss' suffix is a directory and appends a slash to it. Browsers are intelligent enough to do a rediirect, but it causes an HTTP -1 error on link checkers and fills the error log with hundreds of irritating entries.