Hi Leo,
“setDisabled(true);” is used to lock the field. Have you tried to modify it to “setDisabled(false);”?
And the “type”, which must be the Name instead of the Display Name of the field, needs to be checked if it is correct.

For example, here’s my test. It is a marketing page whose status is Live, so the Name of it has been locked. It can be unlocked normally with the JavaScript.

In addition, if the field is in another location, for example in BPF, the corresponding JS is different.
If the above does not solve your problem, it would be better to tell me exactly which field needs to be processed.
If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.
Best Regards,
Nya