The Xpath to set the user role of the target users is only evaluated when the task is created.
If you want to have the role changed in all cases, change it in the model.
If you want to change the targeted users in the app, this can be done by retrieving the list of users in a microflow and assigning them to the association WorkflowUserTask_TargetUsers
Something like this:
If you would like to make it more dynamic, you could created a page, where the user selects the userrole and pass the selected userrole into this microflow and user that as constraint in the retrieve activity.
Another option would be that you step away from user roles, and start thinking in Users. Create a page where you can select a set of users (of any role) and pass the selected list of users in the microflw and set these users as target users.