In all versions of GitLab CE/EE since version 13.0, a privileged user, through an API call, can change the visibility level of a group or a project to a restricted option even after the instance administrator sets that visibility option as restricted in settings.
https://hackerone.com/reports/1086781
https://gitlab.com/gitlab-org/gitlab/-/issues/300017
https://gitlab.com/gitlab-org/cves/-/blob/master/2021/CVE-2021-39903.json