The current EDM parsing infrastructure does not take into account the possibility that a <ReturnType> element contains an <Annotation>.
This causes that a structure such as this (from a Cognos TM1 service):
...ends up messing the close tags, and closing the element containing the <ReturnType> before it should, causing the rest of the EDM to be ignored and the service being inaccessible.
The cause seems to be that the parsing code in the org.apache.olingo.client.core.edm.xml.ClientCsdlReturnType class does not include Annotation among the possible elements contained inside a ReturnType.
As can be seen in the spec at https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/csprd05/odata-csdl-xml-v4.01-csprd05.html#sec_ReturnType, the edm:ReturnType element may contain edm:Annotation elements.