The Multisites ID is computed at the begining of the processing before Joomla start.
Normally, if the VM virtuemart.cfg.php is called directly (that normally is not the case), it contain a wrapper that allow to call JMS to compute the multisites id.
This is a complex algorithm that I don't want to develop here.
In summary, if the correct website is displayed, this means that multisites id is defined because this is it that trigger the dispaly of the correct webpage.
If your add button has not the correct URL then I don't know the reason.
You have ordered JMS on
www.jms2win.com that use VirtueMart and you had any problem with the URL. It uses exactly the same code.
So the problem is somewhere else and I don't know where.
The only solution is to debug your specific environment.
Based on your trace, it seems that the administrator/components/com_virtuemart/virtuemart.cfg.php is correctly installed. So I don't know why.
Perhaps you are using a specific themes (templates) that would bypass everything.
I don't know.