I am preparing a role A which has role B as subcomponent. I would like to get approval from role B business owner to add it to role A. However when I add "dynamic - role owner" to approval node as approver it is resolved to role A business owner instead of role B business owner.
Also if I add a group C as well as subcomponent then the "object - group: owner" is resolved to group C owner. Unfortunately there is no "Object - Role: owner" choice, only "Object - Role: Last Reviewed Date" and "Object - Role: Name".
Has anyone any idea how to overcome this issue? Is there any best practice?
Yes, I've been there. It is not super easy to solve it but I've managed using splits into custom categories. I am not sure if you are familiar with these. There is a public function in the database that lets you define and assign a category using whatever logic you want to implement. My approach was to give the category of Owner:Backup_owner to each indirect role in a request. then call a sub-workflow that splits the request per category. Items that don't have a category don't get processed (those would be your direct roles/modified roles and other objects that are not roles...) and the ones groups by a common category (in my case the owner:backup_owner tuple). Then in the sub flow I grabbed the category and split the values into owner and backup_owner so I can assign the approval to those (build-in variables don't work as they refer to, as you've found out, not the right set of owners).
I split by owner:backup_owner as only splitting by owner could be problematic if you do need a backup_owner in there. And then the edge case of roles being owned by the same owner but different backup-owners would lead to the wrong assignment.