Repository: storybook
Issue: [Bug]: Docs not able to load all inline stories in React project
Labels: bug,needs triage

### Describe the bug

## Framework
React with webpack5 and autodocs enabled

## Issue summary:
I have 5 stories for a modal component which I want to display inline
```
parameters: {
    docs: {
      story: {
        inline: false,
        height: "1100px"
      }
    }
  },
````
This works quite good but not always for all stories. Usually it only loads the first two stories and the last ones are empty in Docs, no matter in which order. Also tried to comment some stories out, same result.

## What I tried so far
I deactivated lazyCompilation in `main.ts`
```
  framework: {
    name: '@storybook/react-webpack5',
    options: {
      fastRefresh: true,
      strictMode: false,
      builder: {
        lazyCompilation: false,
      },
    },
  },
```
which resulted in an error
![Bildschirmfoto 2023-08-29 um 10 12 55](https://github.com/storybookjs/storybook/assets/47920593/12330c5e-7390-476e-b683-76d8281f9161)
 for the not loaded stories


### To Reproduce
#### Reproduction example with a smaller modal which also seems to fail by loading all inline stories
```
const meta = {
  component: ConfirmationDialog,
  title: 'ConfirmationDialog',
  parameters: {
    docs: {
      story: {
        inline: false,
        height: "300px"
      }
    }
  },
  args: {
    isOpen: true
  },
} satisfies Meta<typeof ConfirmationDialog>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
  render: (args) => {
    const [, setArgs] = useArgs();

    const onClose = () => {
      setArgs({ ...args, isOpen: false });
    };
    const onClick = () => {
      setArgs({ ...args, isOpen: true });
    };

    return (
      <>
        <Button.Primary onClick={onClick}>
          Open modal
        </Button.Primary>
        <ConfirmationDialog {...args} onClose={onClose}/>
      </>);
  }
};

export const Default1: Story = {};

export const Default3: Story = {};

export const Default4: Story = {};

export const Default5: Story = {};

export const Default6: Story = {};


```
### System

```shell
Environment Info:
System:
  OS: macOS 13.5.1
  CPU: (8) arm64 Apple M1 Pro
Binaries:
  Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node
  Yarn: 3.2.0 - ~/.nvm/versions/node/v16.18.1/bin/yarn
  npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm
Browsers:
  Chrome: 116.0.5845.110
  Edge: 114.0.1823.67
  Safari: 16.6
npmPackages:
  @storybook/addon-essentials: 7.3.2 => 7.3.2 
  @storybook/addon-interactions: 7.3.2 => 7.3.2 
  @storybook/addon-links: 7.3.2 => 7.3.2 
  @storybook/blocks: 7.3.2 => 7.3.2 
  @storybook/core-common: 7.3.2 => 7.3.2 
  @storybook/jest: 0.2.1 => 0.2.1 
  @storybook/react: 7.3.2 => 7.3.2 
  @storybook/react-webpack5: 7.3.2 => 7.3.2 
  @storybook/store: 7.3.2 => 7.3.2 
  @storybook/test-runner: 0.13.0 => 0.13.0 
  @storybook/testing-library: 0.2.0 => 0.2.0 
  @storybook/theming: 7.3.2 => 7.3.2
```


### Additional context

Overall I have the feeling that my Storybook takes pretty long to load anything. To be honest, my modals are containing a lot inputs and are pretty big. Maybe its a performance issue? Maybe it just times out somewhen?