This is how I would solve it. This solution also works without Accordion.
https://codesandbox.io/p/sandbox/ancient-monad-pt8hjv
Basically, you can create a whole new table within the main table.
Add all the Accordion/nested logic within a single TableCell and add colSpan to match the item length of TableHead.
Then create a new Table within the Accordion and for each TableCell match the width of the columns from the TableHead.