Hi Alex,
My name is Igor, it's a pleasure for me to help others and I'll try to help you.
This may mean bad contact in power cord or wall outlet. Can you try to use UPS (uninterruptable power supply)?
And you may try to turn off all CPU power saving modes in BIOS (different C states) to check if the problem is in motherboard.
See some details at https://docs.microsoft.com/en-us/windows/client...