This is a doozy. We're building a Quarto website with a _quarto.yml.
Quarto pretty much renders every .qmd and .Rmd in the project including old files using the Quarto flavor of YAML (doc here). An old .Rmd script with !r was in the project and was causing the error. It works great when rendering just the .Rmd but not in the context of a Quarto website. Deleting the .Rmd file with !r or setting render targets resolves the issue.
Note: This was very unclear when we clicked the render button in RStudio. It was very clear when we ran quarto render at the command line because it showed us the file that contained the error.