Error: pandoc document conversion failed with error 6

I tried to knit a document and received the following error code:

output file: -3--Table-1a--Participant-Characterization-.knit.md
Unknown option -3.
Unknown option ---Table-1a--Participant-Characterization-.knit.md.
Try pandoc --help for more information.
Error: pandoc document conversion failed with error 6
Execution halted

I looked at this thread and it seems that I have the right version of pandoc:

rmarkdown::pandoc_exec()
[1] "/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc"
rmarkdown::find_pandoc()
$version
[1] ‘3.1.1’

$dir
[1] "/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools"

Sys.getenv("RSTUDIO_PANDOC")
[1] "/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools"

What is the name of your document ? Does it have dash in it ? or even start with a dash ?

It seems the name could be a problem when passed to pandoc as command line argument

Document name does not have dashes

No dash but it starts with a non alphanumeric character. (1). Probably in your example shared before it was (3). Parenthesis are special character in file name so it is replaced by -, hence the starting dash in Pandoc's error.

This is related to this issue

and we'll try to improve and fix this for next version