Discovered this when clicking from "mydata" which is using the non-pretty url. (MyData links should be changed regardless of this bug)

@raprasad huh. Are you saying you can get to the non-pretty URL by clicking something from the GUI? If so, where?
mydata "cards_minimum.html" has a link to a parent dataverse that's "not pretty"
To fix this, additional data is needed in the JSON for card_info.parentAlias
{% if card_info.parentId %}
{% if card_info.parentId != card_info.identifier %}
- <a href="/dataverse.xhtml?id={{ card_info.parentId }}">{{ card_info.parentName }} Dataverse</a>
{% endif %}
{% endif %}
Other lines in this file are correct, e.g:
<a href="/dataverse/{{ card_info.identifier }}"><span style="padding:4px 0;">{{ card_info.name }} Dataverse</span></a>
the issue with the non pretty url has to do with the search include fragment not being aware of the dataverse id.
FYI, there is also a nonpretty version of the url that uses alias (what the pretty url maps too). That should work fine. So if you do need to use non pretty urls somewhere, use those.
These links from My Data have been fixed since 4.8.2 fcec2dcd0cf76671742f11d41b5d3f1da5acb71d, but as @scolapasta suggests, logic should be added to the search-include to resolve the incorrect counts/results.