DIAGNOSIS Intermittent power loss is a connection problem. The battery isn't making solid contact in the tool.
FIX Clean the battery terminals on the tool and the battery pack. Use a clean cloth with a tiny amount of isopropyl alcohol. Scrub the flat brass contacts. Inspect the battery release latches on the tool. Ensure they spring back firmly.
IF THAT DIDN'T WORK The problem could be a weak spring contact inside the tool's battery port. This requires a repair center. Try a different, known-good 20V MAX battery to confirm.
HEADS UP This fault is dangerous during cutting. It can cause the blade to bind and kick. Stop using the tool until the connection is solid.