That’s useful to know. If iCloud and Find My are both grayed out, I’d check for a restriction rather than treating this as just a Find My problem.
First go to Settings > Screen Time > Content & Privacy Restrictions and check the Allow Changes to Settingssection. Make sure Accounts is set to Allow, and see if anything else there is set to Don’t Allow. Apple notes that Screen Time restrictions can gray out Apple Account settings:
If you can't sign out due to restrictions, or your Apple Account is greyed out in Settings – Apple Support (UK)
Also check Settings > General > VPN & Device Management. If there’s a work, school, or other management profile installed, it can restrict Find My and account settings. Don’t remove a managed profile unless you know it’s safe to do so.
If there’s no restriction or management profile and iCloud is still grayed out, I’d go to Apple Support rather than signing out of the Apple Account or resetting the phone.