"Delete unique permissions" in the browser is one folder, and the dialog's fine print is accurate: subfolders that have their own permissions keep them. On a library with hundreds of broken folders it is a week of clicking. PowerShell does the tree in minutes — which is exactly the problem, because two of those folders are broken on purpose.
Step 1: inventory, not action
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/Projects -Interactive
$lib = 'Documents'
$broken = Get-PnPListItem -List $lib -PageSize 2000 -Fields FileRef,FileLeafRef |
Where-Object { Get-PnPProperty -ClientObject $_ -Property HasUniqueRoleAssignments } |
Select-Object Id, @{n='Type';e={$_.FileSystemObjectType}}, @{n='Path';e={$_['FileRef']}}
"$($broken.Count) items with unique permissions"
$broken | Export-Csv .\broken-inheritance.csv -NoTypeInformation
This is one call per item, so on a 50,000-item library expect it to run for a while. It is also the list you send to the owner. Ask them one question: which of these are supposed to be different? Those go in the exclusion list.
Step 2: know who loses access
Before resetting anything, run the who-loses-access comparison over the list. Guests and shared-with users on those folders lose access the moment you reset; the owner should see those names first.
Step 3: reset
One folder at a time, the command is:
Set-PnPFolderPermission -List $lib -Identity 'Client X' -InheritPermissions
Looping it over the inventory is a two-line change. Looping it safely is not: you need the exclusion list applied as a path prefix so a confidential folder's subfolders are protected too, you need each item's who-loses-access list exported before the loop runs, and you need to notice when a reset silently fails on a checked-out or locked item, because the loop will not stop on its own. That is the 80% / 20% line for this job.
Step 4: verify
Re-run the inventory. The count should equal the number of kept items. Anything still showing unique permissions was checked out, locked, or failed silently.
The 100,000-item wall
Lists and libraries over 100,000 items cannot break or re-inherit permissions at the list level. Item-level resets still work. If you hit it, do not try the library setting; work through folders. The Tech Community thread on this ends with the same conclusion: below the threshold by splitting or archiving, or accept per-folder operations.
Doing this with a safety catch
The three failure modes are: resetting a folder that was broken on purpose, resetting before anyone saw who loses access, and not noticing when a reset silently failed. Inheritance365 addresses each: an exclusion list you build from the sweep results, a per-item impact simulation that must be exported before the execute button enables, and a post-write check on every item it resets. It only ever calls resetroleinheritance; it never grants or removes anything else.