It's not a bug but a known design feature. A new buffer is created as
part of the export process and this buffer does not inherit local
variable values.
What you need to do is tell org to set specific
variables upon export. You can use the #+BIND: directive to do this.
I don't know where this is documented but there is mention of whether to
allow this to happen in the org info manual:
If ‘org-export-allow-bind-keywords’ is non-‘nil’, Emacs variables can
become buffer-local during export by using the BIND keyword. Its
syntax is ‘#+BIND: variable value’. This is particularly useful for
in-buffer settings that cannot be changed using specific keywords.
Give this a try.
--
Kaushal Modi