Making a user field not editable when ‘for all users’ is selected

I’m not sure about what you’re asking, but if you’re thinking of modifying Discourse’s code to prevent user fields from being editable, it would require a plugin, and chatGPT is very, very bad at creating Discourse plugins. I would not rely on what chatGPT outputs.