The method byId of the ElementSearchServiceInterface only returns the IDs of the elements and not the element type.
Since IDs between elements are not unique in Pimcore, this causes problems if the IDs eg. of an asset, object or document are the same.
https://github.com/pimcore/generic-data-index-bundle/blob/1.x/src/Service/Search/SearchService/Element/ElementSearchService.php#L79-L81
I noticed this while implementing the dependencies for Studio Backend.