In moodle 3.3.4, it is not possible to give a student immediate access to grouping-restricted course content by adding the students group to a grouping. New grouping changes only take effect after some random time. Also, if a student's group is removed from a grouping, the student still have access to content restricted by that grouping for a semi-random period of time.
Perhaps these problems are related to
, which introduced caching of "user_group_groupings" ? MDL-60188