I have also been working for docx output.
[...]
- With a custom-reference.docx modified to number section headings,
`# References {-}` came out numbered, too; i.e., `{-}` was ignored.
(A proper fix would probably require pandoc to attach a docx style
like "Heading (unnumbered) 1" to such headings.)
[...]
This Lua filter might help you:
Your guess is correct; you have to prepare unnumbered custom heading styles(up to 4th level) in your reference.docx,
also need to point them in YAML frontmatter (or dedicated extra YAML file).