GetItemRepeatConfig removes child items that are used multiple times. How to fix?

Hi community,

I use a classical "GetItemRepeatConfig" query to get a Part BOM over multiple levels. 

id="xyz";
Item partItem = inn.newItem("Part","GetItemRepeatConfig");
partItem.setAttribute("select","id,classification,keyed_name,item_number");
partItem.setID(id); // <- target Part

Item bomItem = partItem.createRelationship("Part BOM","get");
bomItem.setAttribute("select","related_id(keyed_name),sort_order");
bomItem.setAttribute("repeatProp","related_id");
bomItem.setAttribute("repeatTimes","10");

partItem = partItem.apply();

When taking a look at the AML result, I discovered that Parts that are used on multiple levels inside a BOM (e.g. common items like screws) are not returned as complete items. The full related item is available only ONCE inside the AML result, but not for every BOM position that use that Part. 

Here is how the result looks like: 

The image shows three relationship BOM positions. Position 1 and 3 contain the full Part <Item> for the "related_id". Position 2 does not contain the "Item" cause it appeared already present in a previous position.

Problem: Without the date of the related_id/Item, I am not able to render the AML data. In my current use case I want to restructure the AML result in a way that it will also include depth/level of each BOM position. This basically works well, but as soon a duplicate entry appears, the data for the child item is missing:

Here is the current result that I get. I used a placeholder "Data missing" each time the related item is missing:

I discovered that this one is actually a know bug/behavior since over 10 years:

https://community.aras.com/f/archive/2097/developers-forum---getitemrepeatconfig-fix

The solution in the post is to not use GetItemRepeatConfig, but to manually create a query that includes all BOM levels.

Sure, this solution will work. But after 10 years, is this really the solution of choice? My AML query shall also contain other relationships, which would make the query even bigger when we hardcode any level manually. 

Does anyone now a better solution for this one or how to modify the GetItemRepeatConfig query so it returns all data?

Thanks for any help!

Angela