It was a laptop, on location, no peripherals and no accidental key presses. Recording to WAV files, the interrupted file was about 1.25 GB. Besides, with Mac OS formatting I don't think that should be an issue. SSD internal disk, more than 30 GB of free space. Long buffer.
After getting to listen to the files, I can see that before the recording got interrupted there was some glitchy sound, so it didn't just randomly went into play. Also, the gap left between Logic stopping and me realizing and hitting record again was narrower than the actual time that went by. So it glitched, it stopped, it went into play, all while I was looking away.
I guess it's just random bad luck. I haven't had anything remotely like this happen for the past 10 years!