Whatever used to become markdown headers when run in jupyter notebook doesn't render when the same .py script is called through the .qmd file. This is one example line
Markdown('## Processing beads file') | p(display)
This stackoverflow answer suggests that using f'' strings fixed the issue. test it along with including jupyter: python3 in yaml header