When you are syncing permissions from Active Directory to Office 365 and giving access to Sharepoint based on AD group, you can encounter a problem with permissions: members of this group does not have access to the site !
And when you are adding people directly to the Sharepoint group, then access is granted. Why is it so?
It's because group permissions needs to be updated, which can take a long time. To speed process up, you can run crawl, enforcing Sharepoint to read new permissions.
You need to go to Site options, Search and offline availability and run crawl.
Here is how to proceed: