### Bug description

````
---
title-block-banner: true
title: "Something1"
subtitle: "Something2"
date: 2023-04-03
author: "Someone"
institute: "Something3"
format:
  html:
    toc: true
    number-sections: true
    lot: true
    lof: true
    code-fold: true
    fig-width: 15
    fig-height: 15
execute:
  warning: false
  message: false
  echo: false
---
````
````

```{python, error_signals}
#| label: error_signals
#| fig-cap: "Error Signals Grouped By Targets"
#| fig-subcap: 
#|   - "a"
#|   - "b"
#|   - "c"
#|   - "d"
#|   - "e"
#|   - "f"
#| layout-ncol: 2

# for target in targets:
#   temp_dataid=unnested_error_data[unnested_error_data.target==target].dataid.unique()
#   plot_error_signals(temp_dataid,title=target)
#   plt.show()

plt.plot([1,23,2,4])
plt.show()

plt.plot([8,65,23,90])
plt.show()

plt.plot([1,3,2,4])
plt.show()

plt.plot([1,1,1,1])
plt.show()

plt.plot([1,2,3,4])
plt.show()

plt.plot([4,3,2,1])
plt.show()
```

````

the rendered output:

![image](https://github.com/quarto-dev/quarto-cli/assets/61118160/6ba16dd3-0772-44d1-992c-61949a029421)



### Checklist

- [ ] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [ ] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [ ] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [ ] Please document the operating system you're running. If on Linux, please provide the specific distribution.
- [ ] Please provide the output of `quarto check` so we know which version of quarto and its dependencies you're running.
2023-05-11T09:29:16Z
kmink3225
duplicate
closed
Figure subcaptions are randomly arranged in an order I didn't set in a python chunk in a qmd file.
https://github.com/quarto-dev/quarto-cli/issues/5497