Two similar queries with sameAs give significant different number of reults

The two queries below give a significant (factor 10) different number of results and I don’t get why. I’m using OpenLink Virtuoso SPARQL Query Editor as the endpoint and already tried Google/Duckduckgo, ChatGPT and a search here in the forum but I just don’t get it.

The only difference is the optional query of the owl:sameAs property which I then group and thus I should get the same amount of results as in the first query. I’m thankful for any hints and might even miss an obvious error on my side.

Query 1 (112830 results):
SELECT (COUNT(*) as ?resultCount)
WHERE {
{
SELECT ?p
(group_concat(DISTINCT ?kingdom; separator="| “) as ?kingdoms)
(group_concat(distinct ?subject;separator=”| “) as ?subjects)
(group_concat(distinct ?phylum;separator=”| “) as ?phylums)
(group_concat(distinct ?class;separator=”| “) as ?classes)
(group_concat(distinct ?order;separator=”| “) as ?orders)
(group_concat(distinct ?family;separator=”| “) as ?families)
(group_concat(distinct ?genus;separator=”| ") as ?genera)
WHERE {
?p rdf:type dbo:Species .
OPTIONAL { ?p dbo:kingdom ?kingdom } .
OPTIONAL { ?p dcterms:subject $subject } .
OPTIONAL { ?p dbo:phylum ?phylum } .
OPTIONAL { ?p dbo:class ?class } .
OPTIONAL { ?p dbo:order ?order } .
OPTIONAL { ?p dbo:family ?family } .
OPTIONAL { ?p dbo:genus ?genus } .
FILTER NOT EXISTS {
?p rdf:type dbo:Person
}
FILTER NOT EXISTS {
?p dbp:wikiPageUsesTemplate dbt:Infobox_racehorse
}
}
GROUP BY ?p
}
}

Query 2 (9320):
SELECT (COUNT(*) as ?resultCount)
WHERE {
{
SELECT ?p
(group_concat(DISTINCT ?kingdom; separator="| “) as ?kingdoms)
(group_concat(distinct ?subject;separator=”| “) as ?subjects)
(group_concat(distinct ?phylum;separator=”| “) as ?phylums)
(group_concat(distinct ?class;separator=”| “) as ?classes)
(group_concat(distinct ?order;separator=”| “) as ?orders)
(group_concat(distinct ?family;separator=”| “) as ?families)
(group_concat(distinct ?genus;separator=”| “) as ?genera)
(group_concat(distinct ?sameAs;separator=”| ") as ?sameAss)
WHERE {
?p rdf:type dbo:Species .
OPTIONAL { ?p owl:sameAs ?sameAs } .
OPTIONAL { ?p dbo:kingdom ?kingdom } .
OPTIONAL { ?p dcterms:subject $subject } .
OPTIONAL { ?p dbo:phylum ?phylum } .
OPTIONAL { ?p dbo:class ?class } .
OPTIONAL { ?p dbo:order ?order } .
OPTIONAL { ?p dbo:family ?family } .
OPTIONAL { ?p dbo:genus ?genus } .
FILTER NOT EXISTS {
?p rdf:type dbo:Person
}
FILTER NOT EXISTS {
?p dbp:wikiPageUsesTemplate dbt:Infobox_racehorse
}
}
GROUP BY ?p
}
}

since the queries seem rather expensive, please check if they are affected by anytime query feature (see SPARQL over Online Databases - DBpedia Association )
which could lead to partial results and varying counts.
otherwise I have no other hint.