if you’ve got your firmware, look in the android firmware specifically and see the different partitions/filesystems it creates. the gpt.bin is the gpt partition table and it’s written to (i think) four places on the disk. the new table has layout for the firmware __that you have downloaded to install__. it has nothing for windows listed, but the android flash shouldn’t technically overwrite any of the old windows data unless the layout is different form the previous versions you have installed. windows will install itself in the “empty space” provided and also tell efi/firmware about itself.
there’s a tiny chance you could install the same version of android you have installed to trust it’s partition naming and sizing (or find out otherwise…), install it and hope that it never touched the windows partitions (where did it put it’s backup copies of gpt table anyways?) — and then patch together a new gpt partition table that has the old windows filesystems’ locations on it .. and reassociate the windows bootmanager and bootloader.
I wonder why you need to flash android — if you can’t get to Settings to get to security or backup/recovery whatever for a factory reset, then you’d need to flash it. Android usually DOES have a safe mode tho — when you mediumlong press the poewr buttom, a little menu pops up for powerdown options .. either long-pressing power or pressing and holding restart while you press power will give you an option to boot “Safe Mode” which will not launch and startup apps that are not stock android. from there you can uninstall errant apps and do some cleaning or you could factory reset ..
if it’s to have the newest release of android for your device, I’d just take my time getting ready to also install windows =)