Navigation tree rendering problems


for our XWiki we have build our own navigation. Using index numbers, we can prioritize pages and sort them the way we need.

In general the navigation works completly fine, but there is a rendering problem while it loads. After clicking one of the links, the navigation expands for a few ms and it shows the links as external links (like you can see in the following gif).

In our velocity script we are working with >>$chilNestedDoc.getExternalURL() to create the linked pages, but is that the reason for the rendering problem? And is there a way to fix this?