Rmd works fine in R but not in shiny

I am running an Rmd script for a pdf document in a shiny app and latex keeps giving the following error:

LaTeX Error: Illegal character in array arg

when I run the Rmd by itself in R Studio (last version) or in R (v.4.0.0) console using render(), everything works just fine.
I have updated MikTex and tinytex and run tinytex::install.tinytex() to no avail.

This is a snippet from the latex log file after Shiny run:


LaTeX Warning: Reference `LastPage' on page 1 undefined on input line 157.

\c@pagesLTS.pnc.arabic=\count294
\c@pagesLTS.double.arabic=\count295
\c@pagesLTS.current.local.arabic=\count296
[1{c:/Users/.../AppData/Roaming/TinyTeX/texmf-var/fonts/map/pdftex/updmap/pd
ftex.map}

 <./www/Logo.png>]

**! LaTeX Error: Illegal character in array arg.**

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.165 ...}[t]{>{\bfseries\leavevmode\color{red}}l}
                                                   
Here is how much of TeX's memory you used:
 12805 strings out of 482401
 195009 string characters out of 5945271
 478335 words of memory out of 5000000
 28335 multiletter control sequences out of 15000+600000
 568887 words of font info for 49 fonts, out of 8000000 for 9000
 14 hyphenation exceptions out of 8191
 44i,15n,45p,1060b,372s stack positions out of 5000i,500n,10000p,200000b,80000s

!  ==> Fatal error occurred, no output PDF file produced

Please advise, Thank you!