How to solve "HTTP/2 stream 1 was not closed cleanly before end of the underlying stream" error in

I have an app deployed in, which mines data using the bold R package.
However, I am getting the following error appearing in the logs for my app:

2024-01-24T11:05:27.044583+00:00 shinyapps[2720261]: Warning: Error in curl::curl_fetch_memory: HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
2024-01-24T11:05:27.049958+00:00 shinyapps[2720261]:   15: <Anonymous>
2024-01-24T11:05:27.054170+00:00 shinyapps[2720261]:   13: fn
2024-01-24T11:05:27.059003+00:00 shinyapps[2720261]:    8: retry
2024-01-24T11:05:27.063181+00:00 shinyapps[2720261]:    7: connect$retryingStartServer
2024-01-24T11:05:27.067618+00:00 shinyapps[2720261]:    6: eval
2024-01-24T11:05:27.071758+00:00 shinyapps[2720261]:    5: eval
2024-01-24T11:05:27.075890+00:00 shinyapps[2720261]:    4: eval
2024-01-24T11:05:27.079757+00:00 shinyapps[2720261]:    3: eval
2024-01-24T11:05:27.083979+00:00 shinyapps[2720261]:    2: eval.parent
2024-01-24T11:05:27.088113+00:00 shinyapps[2720261]:    1: local

From what I see, the part of the code from which this error is originating is the following:

taxon_total = data.frame()
y <- ceiling(x / 300) + 1
i <- 1
while (i < y){
  fin <- min(300 * i, x)
  tmp <- bold_seqspec(taxon=species[ini:fin], response = TRUE)
  tt <- paste0(rawToChar(tmp$content, multiple = TRUE), collapse = "")
  Encoding(tt) <- "UTF-8"
  taxa <- utils::read.delim(text = tt, header = TRUE, sep = "\t", stringsAsFactors = FALSE, quote = "")
  taxon_total <- rbind(taxon_total,taxa)
  i = i+1

In this case, species is a vector comprising species names for example:

species<-c("Zeus faber","Zeus capensis","Zenopsis stabilispinosa","Zenopsis nebulosa","Zenopsis conchifer")

When I use the application locally, it works without any problem.