If you received that message trying to create the GenuineTicket.xml file, then I would suggest to try it again in Safe Mode. I'm not sure if it will work but it's worth a try. While in Safe Mode right click the gathersstate.exe file and choose Run as Administrator. Hopefully it will create the GenuineTicket.xml file. It will be on the Desktop. If it works, copy the GenuineTicket.xml file to a USB flash drive or portable hard drive. Maybe copy it to both just to be safe. Keep them in a safe place, you will need the GenuineTicket.xlm file to activate Windows 10 after the clean install.
Before you try any of this I remind you again to make a backup of your hard drive. I hope you already did.