At a customer's site, we encountered a few times the issue that when you want to provision ABAP Roles and use the sap_getRoles-Function, it comes up empty, thus deprovisioning all roles in the target repository instead of provisioning new ones!
At one time, the db-type global variable has not been filled correctly.
It is also important to follow strictly the SAP name rules (PRIV:ROLE:<Repository>:<Rolename>).
However, if you don't assign the correct repository in your job, the function, of course, will again deliver a blank.
Do you have similiar experiences?
What else can lead to not welcomed results?