Using this method of creating a reference to a figure in a markdown file produces a double question mark ?? where the reference should be.
According to this answer, when producing a pdf-document from a tex-file, pdflatex should be run twice without deleting the temporary files that are generated. When running pandoc, no temporary files are generated and running it multiple times doesn't change anything.