useField hook in a customField from a custom plugin only works in develop mode
### Node Version

20.18.0

### NPM/Yarn/PNPM Version

10.8.2

### Strapi Version

5.6.0

### Operating System

Linux (Debian/Ubuntu)

### Database

PostgreSQL

### Javascript or Typescript

Typescript

### Reproduction URL

_No response_

### Bug Description

The output of the hook useField hook is the FieldValue object with all undefined

### Steps to Reproduce

1. Create an empty strapi 5.6.0 project
2. Create a custom plugin with a customField.
3. In the component of that customField use the hook useField: const field = useField(name)
4. See what the hook returns

### Expected Behavior

useField must work in production too (strapi build && strapi start), right now only work in "strapi develop"

### Code Snippets


```javascript
import { type InputProps, useField } from '@strapi/strapi/admin'

const InputComponent = forwardRef<HTMLInputElement, InputProps>(
  ({ name, required, label, hint, labelAction, ...props }, ref) => {
    const field = useField<boolean | null>(name)
    // This useField is for testing to see if it can be used to see when another form field changes to show/hide mine.
    const fieldName = useField<string | null>('name')
    // ...
    console.log({ field, fieldName })
    // ...
})
``` 

### Media

**Console log with strapi develop**

![Image](https://github.com/user-attachments/assets/db6c54dd-c69e-4d4b-951a-c793d53d1766)

**Console log with starpi build && strapi start**
![Image](https://github.com/user-attachments/assets/ed938e3b-5f6d-4298-af33-06cb733f462d)

### Additional information

_No response_

### Confirmation Checklist

- [x] I have checked the existing [issues](https://github.com/strapi/strapi/issues) for duplicates.
- [x] I agree to follow this project's [Code of Conduct](https://github.com/strapi/strapi/blob/develop/CODE_OF_CONDUCT.md).