I had a similar problem a while back, but for me it was chunk that gave me this very same error. In my case, it only occurred after a site transfer from test to production. I can’t find the reference to the thread

but what I remember is for some reason, some tables were improperly created with the id field not being set to "auto-increment".
Check that modx_site_tmplvars has the id field set to auto-increment, I hope that will help, not sure I remember this correctly.
Last question : is you MODx install a fresh 0.9.2.1 install or an update ?