We have a ADX portal with two environment, the 90% of the settings are similar as the UAT was recently ported over form the production. Both are on premise deployment. In the portal we have tree view menu in few pages. The menu works perfectly fine for most of the cases, whereas for few cases where there is no children the menu have "Liquid error: Exception has been thrown by the target of an invocation." error. 

I managed to find which part of the codes is throwing this error. From the below code the line which was highlighted is the one that is causing the problem. We are using the same set of code which was from ADX portal example. 

{% assign depth_offset = depth_offset | minus: 1 %}

{% for parent_sibling in current_page.parent.parent.children %}
{% if parent_sibling.url == current_page.parent.url %}
<li>

Our page structure looks some thing like below. In this when we try to access Child1Sibling1 we get the error. Whereas the rest of the pages are fine.

Home

-Child 1

-Child1Sibling1

-Child1Sibling2

-Child1Sibling2Sibling1

-Child1Sibling2Sibling2

-Child2

-Child2Sibling 1

-Child2Sibling 1Sibling1

-Child2Sibling 2

--Child2Sibling2Sibling1

-child3

-Child2Sibling 1

-Child2Sibling2

Any help regarding this problem will be greatly appreciated. Thanks in advance.