Compile with Kindlegen: weird error

I am using the compile option in Scrivener on my short story to create ebook files. The story compiles fine into EPUB, also compiles into XHTML without problems.

But when I compile using Kindlegen, I get this weird error:

I can still compile into MOBI by using Mobicreator on my XHTML file, but that doesn’t always turn out a file that KDP will find acceptable. And anyway, weird errors annoy me.

Both Scrivener and Kindlegen are up-to-date, and Scrivener is pointed to the correct Kindlegen directory. I know that other people compile with Kindlegen, so any help on defeating this error?