Navigation tree rendering problems

Hi,

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).
Rendering_problem

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?