Pandoc places curly brackets around square brackets

A question with the same title has been answered on Stackoverflow and I can confirm that, in a terminal, $ echo '\mycommand[options]{something}' | pandoc -t latex works fine, square brackets are untouched.
Nonetheless, invoking pandoc through rmarkdown::render() the process aborts with the following message:

! Undefined control sequence.
l.90 \newcolumntype

The message shows that curly brackets have been placed around the square brackets.
This is the example Rmd I used:

title: "R Notebook"
output: pdf_document
some text
other text

Is the difference in the outputs due to some of the pandoc command-line option?
This is what I can read in R console:

"C:/PROGRA~2/Pandoc/pandoc" +RTS -K512m -RTS --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output PandocSquareBracket.tex --template "C:\Users\ro\Documents\R\win-library\3.5\rmarkdown\rmd\latex\default-" --highlight-style tango --pdf-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --variable "compact-title:yes"

How can I get the line working as Latex command?
Many thanks, Roberto