Why are you trying to use this query, rather than simply:
SELECT (COUNT(DISTINCT ?x) AS ?nox)
WHERE {
VALUES ?topClass {gfo:itemOne gfo:itemTwo}
?x gfo:involves/rdf:type ?topClass
}
Or also:
SELECT (COUNT(DISTINCT ?x) AS ?nox)
WHERE {
{?x gfo:involves/rdf:type gfo:itemOne}
UNION
{?x gfo:involves/rdf:type gfo:itemTwo}
}