When you say "custom object 'pac_beneficiaries' linked to 'inv'", can you please expand on this. Is pac_beneficiaries a sub-object of Project. I'm assuming yes as your XOG has odf_parent_id which you are setting from inv_investments.code.
I have never taken this approach and used:
parentInstanceCode="XXXXX" parentObjectCode="project" (where XXXXX is the Project Code)
in the 'instance' tag.
Please set-up sample data in your non-prod environment, and XOG out the data, which will then show you the format of the XOG file you should be replicating for your GEL scripts.