In case it helps anyone in future ...
I spent some more hours digging around and trying to understand how this JForm works. Finally I did the following and it works now:
1. stripped out the <fields name='projectfields'> tags and
2. changed " foreach ($form->getFieldsets('projectfields') as $fieldsets => $fieldset)" to " foreach ($form->getFieldsets() as $fieldsets => $fieldset)"
Two other by-products - the fields are rendered with the correct names (esp. important for the hidden fields) so "option" instead of "projectfields[option]", and also $form->getInput('title'), $form->getLabel('title') and $form->getValue('title') all work now. Previously getInput worked but neither of the other two functions.
I don't know what the <fields> group is for - something to do with control groups - but I'm not bothered. The documentation for this is truly abysmal :)