Your approach won’t solve that, you’d need to also flash the chip with patched / clean firmware
For example, would loading Grub first, and then loading Windows from Grub, prevent the issue?
If you wipe the whole disk, you still need to use a bootable restore USB to restore it.
This has nothing to do with the fact that it is UEFI booting.