> The yaml used to reproduce the error is absolutely
> minimal (just two lines with three dashes each will reproduce the error).
It doesn't happen to me when I end the file with three points instead of three dashes.
Three dots is the correct way to end a YAML stream, variations permitted by Pandoc metadata blocks and other tools notwithstanding. Three dashes signal the *start* of a YAML document within a stream, so if you "end" the file with three dashes some parsers will (correctly) see that as the start of a second, empty document, and may discard all but the last document in the stream and ergo you get an empty or invalid value. I believe that correctly they ought to discard all but the *first* document (I have no time to look it up in the spec), but there you have it.