So, I've been thinking, and I have a new theory. It is strange that I have the same issue with two different motherboards from the same manufacturer, it can't be a coincidence... Well it can, but as I said, I would be quite unlucky.
What if this issue is triggered by my case power switch/cable? Since I have this case I was never able to force a shutdown in any of the motherboards I ever had (pushing the power button for several seconds until it shuts down) because the motherboard turned off, but turned itself on two seconds after, as if the power button was still being used.
Correct me if I'm wrong but I'm reading on several forums and
according to this Gigabyte backup bios can be triggered by pressing the power button for some seconds. Perhaps that's my issue? Maybe my case has been malfunctioning for ever whether is the cables or the button and in the case of Gigabyte, that causes the backup bios to perform a bios flash.
When I fixed this issue in my old motherboard, I remember I only flashed one of the bios, I don't remember everything exactly but that motherboard had a hardware switch to run dual or single bios mode, if I left that switch on single mode the fix could have been that, as there was only one bios enabled, the backup one couldn't be triggered, and not the flash as I stated in the thread.
I don't know, this is my more plausible explanation for my issue. When I reboot the system from Windows it doesn't happen, it only happens when the pc is turned off and I turn it on (and not always). Unfortunately I don't know how to test it, I would need another case and all of them are in use right now.