"Configure it later" button does not appear sometimes in Group Settings page

Summary

E2E spec to check audit logs for 2 factor authentication enabling/disabling fails because of this flakiness in the UI. On clicking "Require two factor authentication" checkbox and clicking "Save settings", the "Configure later" button at the top of the page does not appear in the group settings. It happens only on occasion.

Relates to: #378703 (closed)

Context: !103786 (comment 1170194558)

Steps to reproduce

Example Project

What is the current bug behavior?

Configure it later button does not appear at times when clicked on Save Settings.

What is the expected correct behavior?

Investigate why it doesn't appear sometimes.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Screenshots

Screenshot govern_group_for_enable_and_disable_2fa_requirement_behaves_like_audit_event_log_2022-12-08-05-47-57.097

Possible fixes

Edited by Harsha Muralidhar