Uploading entry files is broken since version 5.4.0
<!--
Hello 👋 Thank you for submitting an issue.

Before you start, please make sure your issue is understandable and reproducible.
To make your issue readable make sure you use valid Markdown syntax.

https://guides.github.com/features/mastering-markdown/

Please ensure you have also read and understand the contributing guide.

https://github.com/strapi/strapi/blob/main/CONTRIBUTING.md#reporting-an-issue
-->

## Bug report

### Required System information

<!-- Please ensure you are using the Node LTS version (18, 20, or 22) -->
<!-- Strapi v3 is no longer supported, please update to Strapi v4 -->
<!-- If you are reporting a frontend bug please provide error logs after setting STRAPI_ENFORCE_SOURCEMAPS=true in your .env -->
<!-- This environment variable makes frontend errors easier to read and trace -->

- Node.js version: 20.9.0
- NPM version:
- Strapi version: 5.4.0 and latest
- Database: sqlite
- Operating system: darwin-arm64
- Is your project Javascript or Typescript: TypeScript

<!-- Did you know you can run `yarn strapi report` or `npm run strapi report` to get this information easier? -->

### Describe the bug

The bug appears starting from version 5.4.0 and persists in subsequent versions: it is no longer possible to update the file linked to an entry (via [upload entry file query](https://docs.strapi.io/dev-docs/plugins/upload#upload-entry-files)) if the entry already has a file.

### Steps to reproduce the behavior

1. Have an entity with a field of type Media.
2. Upload a file linked to this entity using, for example, following parameters:
```
{
  ref: 'plugin::users-permissions.user',
  refId: userId,
  field: 'avatar',
}
```
3. Try again now that the user already has an avatar.

### Expected behavior

Each time a file is uploaded, the user's avatar should be updated. But the problem is that the file is uploaded successfully, but the new relation is not set once the user already has an avatar.

### Screenshots

If applicable, add screenshots to help explain your problem.

### Code snippets

If applicable, add code samples to help explain your problem.

### Additional context

Add any other context about the problem here.
