Fix mutations of frozen object in feature_setting.rb
What does this MR do and why?
This change fixes a bug in the AI feature settings code that was accidentally modifying shared data. The main fix changes the code to create a copy of the feature list before making changes to it, preventing unintended side effects. The testing was also improved by setting better default values and adding more comprehensive test cases to ensure the feature filtering works correctly under different conditions (like when users have or haven't accepted testing terms, and for premium license holders). This makes the code more reliable and prevents potential issues where one part of the system could accidentally affect another.
Following instruction here to get it backported: https://gitlab.com/gitlab-org/release/docs/-/blob/master/general/patch/engineers.md#backporting-a-bug-fix-in-the-gitlab-project
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #560746 (closed)