Capture template for org-roam-bibtex to keep notes in single file

As the title says, I want to setup org-roam-bibtex so that I can capture notes for different papers/articles in a single file.

This is what is in my init.el:

(use-package org-roam-bibtex
  :after org-roam 
  :hook (org-roam-mode . org-roam-bibtex-mode)
  (setq orb-preformat-keywords
	'("citekey" "title" "url" "author-or-editor" "keywords" "file")
	orb-process-file-keyword t
	orb-file-field-extensions '("pdf"))
  (add-to-list 'org-roam-capture-templates
	       '("r" "bibliography reference" plain
		 (file "~/org-roam/org-notes/template")
		 (file+head "~/org-roam/org-notes/${citekey}.org" "#+title: ${title}\n")))
  (add-to-list 'org-roam-capture-templates
	       '("w" "work bib reference" plain
		 (file "~/org-roam/org-notes/template")
		 (node "Work notes")
		 )) )

(I also have some related org-ref and org-noter settings but this post is already pretty long.)

The template file looks like this:

* %^{title}
:Custom_ID: %^{citekey}
:URL: %^{url}
:AUTHOR: %^{author-or-editor}
:NOTER_DOCUMENT: %^{file}  

- tags ::
- keywords :: %^{keywords}

The file has its own org-id and properties at the start of the document:

:ID:       6afe41ce-2572-4c55-b624-f43e65d7ccc8
:ROAM_ALIASES: "Work notes"

On the line cite:wisemanTwoBellTheorems2014, doing C-c C-o will give me my helm popup, and choosing Add notes gives me the capture interface.

Hitting w gives me an error:

orb-edit-note caught an error during capture: Capture abort: Args out of range: 0, 0

and I am not shown the notes page.

It also adds :ROAM_REFS: cite:wisemanTwoBellTheorems2014 to the PROPERTIES drawer of

However, if I make a new Headline in

* Symmetry breaking patterns in superstring models
:Custom_ID: wittenSymmetryBreakingPatterns1985
:AUTHOR: Witten, E.
:ROAM_REFS: cite:wittenSymmetryBreakingPatterns1985
:NOTER_DOCUMENT: ~/Dropbox/papers/Witten_1985_Symmetry breaking patterns in superstring models.pdf  
:ID:       8e376322-ee58-4b83-9b20-bc2d1d1d5447

And do C-c C-o on cite:wittenSymmetryBreakingPatterns1985, I get the option to Open notes, and am led to the correct headline and notes.

What can I do to make sure that I’m adding the desired behavior when I want to create notes for a citation? (If you have a simpler setup that is similar to what I want, please share!)

I think it’s related to creating an org UUID for the headline, but I’m not quite sure how to do this in the template.

I’m using org-roam-version 2.1.0, and emacs-version 27.2.