Error from Service?

Why does this error result-

Error-
Failed to run query: com.complexible.stardog.plan.eval.operator.OperatorException: com.stardog.stark.query.io.InvalidQueryResults: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 443; The element type "link" must be terminated by the matching end-tag "". [L1:443]

for this query-

PREFIX wd: <http://www.wikidata.org/entity/> .
PREFIX wdt: <http://www.wikidata.org/prop/direct/> .

select *
WHERE
{
?agt a foaf:Person ;
schema:sameAs ?sa .
filter regex(str(?sa),'wiki','i')

SERVICE https://query.wikidata.org/
{
select *
WHERE
{
wd:Q51120429 ?p ?o
}
}

}

The query works when used in Wikidata sparql endpoint.