I developed something for a similar purpose. This is not exactly what you are looking for but It can be modified for your need. The code is tested and run without any error. What the code does:
You need to give the starting point(Site Url)
The code Starts from a given SiteUrl goes to each subsite and each one fetches all the people have access to that ...
Try using your endpoint URL like given below:
var endPointUrl = url + "/_api/web/GetFolderByServerRelativeUrl('Style%20Library')/ListItemAllFields/breakroleinheritance(copyRoleAssignments=true, clearSubscopes=true)"
Similar questions for Reference:
Break inheritance on a folder using REST.
Sharepoint Rest API breakRoleInheritance Of Folder.
You might want to check out these two articles on permission scope limits, I have a feeling you might hit these if you implement this kind of solution. With that many folders you should look into moving some folders into their own document library. Not to mention you are going to run into view limit issues unless you have setup column indexing and really ...
When you approve access via email it adds you to an existing group in that site(if the settings for that group is wrong Nothing will change
There are several ways to test this.
I would take the following action to see what is the issue.
From what I see you have put some exception on the group permission
First Try to add yourself Directly to that Site
You can not "hide" the pages. You could prevent users from modifying the page by revoking the "Add and Customize Pages"-Permission (i.e. by moving them from the default "members" to a new group)
You could also change the permission-level of the members group from Edit to Contribute. That way no-one is able to modify the pages. For those that need to edit ...