Querying DM and links: RM %s has no link document, so you can not query for this

In my A12 Java backend, I want to get all documents and their linked documents.
For this I created the following code:

        QueryRoot query = QueryRoot.builder()
                .targetDocumentModel(documentModelId)
                .projectionName("document")
                .constraint(ExactMatchOperator.builder()
                        .field(businessKeyFieldPath)
                        .value(businessKeyValue)
                        .build())
                .exclude(false)
                .link(QueryLink.builder()
                        .relationshipModel(relationshipModelId)
                        .targetRole(linkTargetRole)
                        .linkDocumentConstraint(ExactMatchOperator.builder()
                                .field(linkedDocBusinessKeyFieldPath)
                                .value(linkedDocBusinessKeyValue)
                                .build())
                        .build())
                .paging(Paging.builder()
                        .pageSize(5)
                        .pageNumber(0)
                        .build())
                .build();
        QueryPage<DocumentTreeResult> queryResult = queryService.query(query, null);
        

However when I run this, I get the following error:

- path: $.links[0].linkDocumentConstraint message: | RM %s has no link document, so you can not query for this. 
  1. How to interpret this error? Yes I don’t have any links right now, but then I expect an empty result, not an error!
  2. Why is the RM name not inserted? It is definitly set.

Interesting. Out of curiosity, I tried the same in a test of ours, and it worked just as expected.
Like this:

                .link(QueryLink.builder()
                        .relationshipModel("Rel_Contact_Hobby_Plus_RM")
                        .targetRole("Hobby")
                        .linkDocumentConstraint(ExactMatchOperator.builder()
                                .field("/root/StartDate")
                                .value("2025-09-11").build())
                        .build())