Unable to process template language expressions in action

I am using "Grant access to an item or a folder" and giving Role "Can Edit" to one of the user using Flow.

after running flow, user able Edit Records,

but when I want to rollback Edit rights, I am running flow for same user and giving Role "Can view"

he is stil able to edit, what I want, read only access now and not edit

Hello Chetan! Granting one permission doesn't exclude another one that was granted before - this is how SharePoint permissions work. I would advise you to delete all permissions for a user in the flow first and then grant the one you want.