The environment variable (%HOME%, in this case) may have been an unexpandable REG_SZ value in the registry. The only way to know whether that is/was the case or not is to check the appropriate key in the registry. Global environment variables are defined at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment , and local environment variables are defined at HKEY_CURRENT_USER\Environment. The name of the value will be the environment variable's designation (without the percent identifiers), and the value's data is what the environment variable will be replaced by (expanded to) when used in a valid context.
The registry is a rather esoteric system, though. If the environment variable's value is of type REG_SZ (essentially, a basic string), then no expansion using other environment variables will occur. This can cause problems because most parsers expect that an expanded environment variable will produce an absolute path to a valid location. The potential conflict of interpretation can be avoided by defining environment variables using REG_EXPAND_SZ -- this type of value will undergo environment variable expansion before the literal string is returned to the accessing program.
That explanation is probably too long-winded for most; just ensure that any environment variables which utilize other environment variables in their data are of type REG_EXPAND_SZ.