Quazi-quoting does weird things during the compiling stage. I brought this up with the author of Yesod, but there doesn't seem to be a great place to put it in the documentation.
It's been a while since I've tried this, and since I've seen the error, so I'm hoping it's the same error you had. And the answer is that the problem has to do with when the quazi-quoter is processed, between the different compiler passes of ghc. So, to fix it, you have to do things like make sure that the quazi-quotes are (I think?) at the bottom of the file. And if that causes problems, you have to play around with isolating the quazi-quotes from other parts of your code, by putting them into include files.
That said, that the example wouldn't even compile sounds like a bug in the documentation.