This is very similar to
SERVER-50246, however in that case there was no document source rewrite taking place per se but simply executing the sub-pipeline as part of explain was losing stages in the sub-pipeline that were eligible to push into the find layer. For instance, SERVER-50246 would fix an issue like this:
However, there was an oversight with the implementation whereby the inner $match can actually come from a rewrite for a pipeline like this:
which gets optimized to:
The current explain output for the second example does not include the $match pushdown, and subsequently may not show the correct access plan (e.g. IXSCAN on _id).