Hi gullivereu,
I didn't add special thing to my page template or web template, and didn't set a value to entity name field.

You could check whether fetchXml is correct.
To get correct query, we can copy the correct fetchXml query by opening console.(F12)
Open Network > XHR, clear existing info in console then click refresh

We can get the correct N:N retrieval, copy the encoded fetchXml query,

decode it in following website.
https://www.urldecoder.org/

Prettify the decoded fetchXml
https://jsonformatter.org/xml-formatter

At last, copy the formatted fetchXml to web template.
In addition:
1. In my code, I named fetchXml to secondaryCompany,
thus when looping the result, the collection name should match to it.(You are using "compte", which is not defined in your code.)

2. To display account for sign in user, we should create a new entity permission record based on Account, and set its scope to global.

Assign the permission to authenticated user:

Contact should be assigned with the role to get access to data:

Regards,
Clofly