I have a script that creates two groups, a hand full of folders, and sets permissions on those folders. In my testing environment all of these processes work without issue b
I had the exact same issue. It turns out, our filesystem only updated it's own cache of SIDs every 20 - 30 seconds. So if I created a new SID and tried to apply it to a folder straight away, our filesystem would say the SID was unknown. I modified a setting on our filesystem to allow it to accept 'unknown' SIDs (even though they were known to AD and it just hadn't updated). More info here:
Issues With New-ADGroup, Set-ACL and Network Folders
Sleeping the script is definitely not an option when you have 7.5 million files and folders!