Thanks to Murray Cadzow who figured out the solution to this on Twitter! https://twitter.com/MurrayCadzow/status/1232897913199554560
In his own words:
By default in a non interactive session bookdown::render_book() will clean the environment before rendering. You could try running as bookdown::render_book(..., clean_envir = FALSE)
After adding , clean_envir = FALSE
to my code everything finally works!