Just so you know, we are saying the same thing.
I am not trying to solve the problem at this point but showing you where the problem is by elimination.
How do you pass species from R to Quarto to Typst? That is where it fails. And yes I know it works for the data. It’s just the data is formatted within the Quarto file where the sidebar is formatted within the Typst file.
In the .qmd file, in the header, you would want to receive the .x (containing the current species) from render.R if you understand what I mean. Where you have params: species:.