This issue happens if the site collection feature "Limited-access user permission lockdown mode" is active.
Go to your root site of the site colleciton-> Site Settings-> Site collection features under Site Collection Administration, Deactivate the site collection feature "Limited-access user permission lockdown mode".