Keys seem to randomly go missing from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList, which causes userenv to freak out and not assign user profile environment variables.
However this does not seem to happen only at logon. Some programs (e.g. Chrome setup) trigger this behavior reliably even without a reboot.
E.g. the following message is an indicator of this problem:
This should never happen since CSIDL_INTERNET_CACHE is defined as a catch-all container requiring no suffix. That means when wininet was loaded, this folder could not be determined (likely because of a missing USERPROFILE variable)