With Provisioning any time you have a %example% in the unattend it expects that there is a public variable assigned to the value. It is giving you this error because the WINDIR variable is not defined. You can either define the WINDIR or explicitly put the path.
OSD does not interact with the unattend file and provisioning does. This is why there was not an issue with this while using OSD.