Hide/Show Restricted Content Not Working: Restricted content now showing resolved
Even with the group settings in place, you are having issues where the Hide/Show toggle for restriction is greyed out and not clickable. The restriction is hidden by default and cannot be enabled. Your assigned group cannot see the resource or activity even though you have set the correction rules and your resource or activity says “Not available unless: You belong to GROUP NAME (hidden otherwise)”.
Hide/Show Access Restriction Greyed Out (not clickable)
When making certain resources or activities restricted access, e.g. Topics, the Restrict access settings for chosen Group is greyed out and not clickable. See image below.

Moodle Students in Group Cannot See Restricted Content
Even when Restrict access rule is correct, your Group still cannot see the resources i.e. even though at the bottom of the resource or activity reads “”Not available unless: You belong to GROUP NAME (hidden otherwise)”, your users in that group still cannot see the resource.
While the restriction will ensure that users belonging to certain user groups will have access to the resources, with the group restriction and chosen group added, the hide/show toggle immediately changes to hide.
They are greyed out and no longer clickable. If the restriction by group is removed, the hide/show toggle works as expected.
Cause: This is because the group in question have Group Membership Visibility not set to visible i.e. Hidden.
Step-by-Step to Resolve Students in Group Not Seeing Restricted Content
Solution: set the Group membership visibility to “Only visible to members”.
You need to go back to the resource or activity and select a group with “Only visible to members” set.
Your target group has Group Membership Visibility set to Hidden?
This setting can only be changed on groups with no users. If an existing group with users has the Group membership visible setting set to Hidden, it will then be locked. You can do one of two things: create a new group or remove all users from that group and switch to the “Only visible to members” setting for Group Membership Visibility.
If you have Group membership visibility set to Hidden, then this removes access to the Hide/Show toggle.
Here are the steps:
Step 1: Create a new group and set the following
This setting locks once you add users to the group; therefore, configure the setting below.
Group Membership Visibility > Only visible to members (See image below)
We also recommend unchecking the checkbox “Show group in dropdown menu for activities in group mode”.
When ready click Save changes

Step 2: Add users to this new group.
If you choose to remove users from your existing group and make the above change, you will need to re-add the users again.
If you are creating a new group, remember to add users to this new group.
Step 3: Edit your Resource or Activities (in our case Topics) Restrict access setting
Now give your new or current group access to the restricted content. Go to your resources or activate and change the Restrict access setting to give access to this new group (or if you are keeping your previous group, you can check that the rule is correct for that group) – see image below.
Repeat this for all the resources or activities assigned to this group. Remember to click Save changes.

Your users in the group will now be able to access the restricted resources or activities.
This pertains to Moodle 4.2 and above.