How to generate tabset-paned programmatically to plot charts in Quarto document

Using #| fig-align: center will cause tabsets to fail to generate.

Tabsets

:::{.panel-tabset}

#| results: asis
#| fig-align: center

iris |>
  dplyr::group_split(Species) |> 
  purrr::iwalk( ~{
    # create tabset for each group 
    cat( '### ', .y, ': Species "', unique( as.character(.x$Species) ), '"\n', sep = '' ) # tabset
    plot(x = .x$Sepal.Length, y = .x$Sepal.Width)
    cat('\n\n')
  })

pic1

:::

But #| fig-align: default generates tabsets. Why such a strange result, which is repeated in R markdown files.

pic2

I wonder what causes such different display and why

#| fig-align: center

causes such unusual output?