[Relations on the fly] Nested relations edition leads to error message
### Node Version

v20.18.1

### NPM/Yarn/PNPM Version

npm

### Strapi Version

v0.0.0-experimental.e12978dcee698470990e9c5c63384faf2c307443

### Operating System

MacOS

### Database

SQLite

### Javascript or Typescript

Javascript

### Reproduction URL

_No response_

### Bug Description

When in preview, I edit a relation entry that also has a relation entry, if I try to edit this second relation, it leads me to an error message.
Update : not for ALL relation types ! it leads to an error for MANY TO ONE but not for MANY TO MANY

### Steps to Reproduce

1. Use Launchpad
2. Open Articles in CM
3. Go to an article
4. Open its preview
5. Click on a relation entry in Categories (here : content)
6. Check the Content relation modal is displayed
7. Click on relation entry in Articles (MANY TO MANY)
8. Other relation modal pops up and you can make updates
9. Go back (back arrow doesn’t work btw)
10. Click on relation entry in Product (MANY TO ONE)
11. Check the error message

### Expected Behavior

Relation modal should open for every relation type fields

### Logs

```shell

```

### Code Snippets

Error in console : 

script.js:1 React Router caught the following error during render TypeError: Cannot read properties of undefined (reading 'layout')
at InputRenderer (chunk-KGGXPUFY.js?v=54a94976:85459:55)
at renderWithHooks (chunk-AWHRF5BE.js?v=54a94976:11548:26)
at updateFunctionComponent (chunk-AWHRF5BE.js?v=54a94976:14582:28)
at updateSimpleMemoComponent (chunk-AWHRF5BE.js?v=54a94976:14463:18)
at updateMemoComponent (chunk-AWHRF5BE.js?v=54a94976:14366:22)
at beginWork (chunk-AWHRF5BE.js?v=54a94976:15977:22)
at beginWork$1 (chunk-AWHRF5BE.js?v=54a94976:19753:22)
at performUnitOfWork (chunk-AWHRF5BE.js?v=54a94976:19198:20)
at workLoopSync (chunk-AWHRF5BE.js?v=54a94976:19137:13)
at renderRootSync (chunk-AWHRF5BE.js?v=54a94976:19116:15) {componentStack: '\n    at InputRenderer ([[http://localhost:1337/admin…pi/vite/deps/chunk-NTYLP2DN.js?v=54a94976:5026:5](http://localhost:1337/admin%E2%80%A6pi/vite/deps/chunk-NTYLP2DN.js?v=54a94976:5026:5)](http://localhost:1337/admin%E2%80%A6pi/vite/deps/chunk-NTYLP2DN.js?v=54a94976:5026:5))'}

### Media

![Image](https://github.com/user-attachments/assets/48a6a690-8315-485d-bc06-b31d9023023c)

https://github.com/user-attachments/assets/e29ed66c-6f35-41d4-9d31-c55496e71f60

### 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).