I thought I might have found - thanks to your excellent idea and discovery - a solution. But sadly it does not work optimally for my use case: I am using Pandoc for converting Obsidian Markdown notes into Apple Notes.
I think (with Shortcut) I can’t pass a “note” as an input, to have a series of files to be attached to it.
I can only “create” from scratch a new note.
Just leaving this here in case anyone stumbles across this thread. I found some weird behavior while writing a command line interface to notes related to attachments. This is what Claude Code and I found out:
Manual UI Attachments
Embedded as base64 data URIs: <img src="data:image/png;base64,...">