Not sure if it's related or not, but here is a similar-sounding problem I was similarly frustrated by last year.
Some of my 'ruleouts' ended up being inadequately ruled-out given the unknown environment variables passed from RStudio to the odbc call when running in a shell.
My problem was solved by creating a wrapper for the RStudio Server service which passed additional environment variables - these passed to the odbc driver, even though the ones in Renviron.site didn't.