Some relatively simple queries may not round trip properly when parsed and then output with SparqlQuery.ToString() e.g.
SELECT * WHERE { { ?s ?p ?o } FILTER(ISURI(?o)) }
This appears to be a bug in ToString() somewhere, most likely in GraphPattern.ToString() as when formatting with SparqlFormatter.Format() the query will round trip fine