Per my test, in addition to grant users with custom permission, you should also activate the "Limited-access user permission lockdown mode" feature in the site collection features.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.