Check these possibilities:
  ● If an app or feature on your device is not working, not appearing, or is restricted (grayed out), a frequent reason is it may have been disabled using Screen Time, or by a technology administrator if you are using a device owned by an employer or educational institution.
- Read this support article If your Apple ID or other options are greyed out in Settings —> If your Apple Account is grayed out in Settings, or you can't sign out - Apple Support
  Tap your Settings app > Screen Time > Content & Privacy Restrictions > scroll to Allow Changes and turn on.
- If the device is managed (check: Settings > General > VPN (or Profiles & Device Management), contact the technology department of the organization that is doing the managing.
   
  ● Situation where a VPN was preventing action —> Unable to sign out of my Apple ID on my i… - Apple Community