SPARQL query throwing compilation error

How are you actually running this query, is it via your Virtuoso SPARQL endpoint (ie ~/sparql) ?

As by default the Virtuoso SPARQL endpoint form page has the Strict checking of void variables option checked, and if I run your query against one of our Virtuoso open source endpoints like the one we host for Wikidata, I get the same error, even without having any of your data, as can be seem here.

So you need on uncheck the Strict checking of void variables option on the SPARQL endpoint form page before running the query for it to run.

Also, how many triples are in the Virtuoso instance, as checking the INI file provided it does not appear the Virtuoso instance has been Performance Tuned, as the NumberOfBuffer param is still set to the 10000 default value. Meaning there will be very little of the system memory allocated to Virtuoso for hosting the database working set, which if large will result in poor performance as the data needs to be swapped to and from disk. Thus you should tune instance as detailed in the document.