but my problem is re-adding the
instance I need to a now sorted array
Your first problem is getting the correct values into that very first HISM Indexes array. Think about it. You hit some instances with MultiSphere Trace but here you’re adding just 0,1,2,3 indexes of an array - these are not HISM instance IDs.
Instance IDs come from the Hit Item when you break the Hit Result struct - and you probably already have it.