I've had that happen a few times but never that long into a print. That's quite upsetting.
After the 3rd time I bought a refurbished UPS from the Micro Center. I calculated it should keep the printer running for 9 or 10 minutes more in the event of a power failure. It helped a couple of times for some momentary drop outs.