This error seems to occur when you try to grant permissions to apps (or apps request some permissions) as you can see in the screenshot below. The screenshot is from Moto G4 Play which seems to be affected by this issue.
What Causes it?
It’s likely that you have some app running in the background that’s using screen overlay and for some reason it makes it impossible to change permissions.
How to fix it?
Turn off all background apps and pay special attention to apps that change your color temperature. These apps are usually the most common culprit especially the app Twilight as was the case on my phone.
You can also just pause the app temporarily while you change the permissions and that will also fix the issue.
To fix the issue permanently you will have to uninstall the app that’s causing the issue.