Ran the command with sudo
like sudo grub2-mkconfig -o /boot/grub2/grub.cfg
in dom0 terminal and it worked
after hitting enter -
Generating grub configuration file …
Found some text…
error: syntax error.
error: Incorrect Command.
error: synta error.
syntax error at line 164
Syntax error are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub and /etc/grub.d/*