Dynamic datasets, where the dataset to query is constructed out of the graphs of the underlying dataset behave differently for in-memory and TDB datasets.
TDB supports them natively when FROM, FROM NAMED are used.
SPARQL_QueryDataset#decideDataset provides the feature for SPARQL protocol (default-graph-uri=, named-graph-uri= externally to the dataset.
Other datasets do not support the feature. Henc, in-memory dataset services does not support it when FROM, FROM NAMED used but does when default-graph-uri=, named-graph-uri= used.