Hi,
As per this Workflow - Issue with “Define Variable” operator? - Identity Security Cloud (ISC) / ISC Discussion and Questions - SailPoint Developer Community, and also we have experienced it that steps that come after loop cannot reference the steps inside the loop.
As shared in the above link, you can check Recursive workflow concept to achieve this - Recursive Workflows in IdentityNow - Content / Community Blog - SailPoint Developer Community
Thanks