Auric Goldfinger says
Once is happenstance.
Twice is coincidence.
Three times is enemy action.
Similar applies to things electronic, but mayhaps not quite just 1 2 3 ...
ie almost anything can have a very very occasional fault "just because" unless exceptional steps have been taken to prevent it by the designer.
Alpha particles emitted from the plastic in ICs when they are struck by cosmic rays can cause random memory bit flips in dynamic RAMs which may cause crashes. That's close to happenstance.
If it was mine and was getting near the end of a warranty period I'd think harder about whether any other indication had been given recently of problems. But any other time I'd note it and wait to see if it happens again. Two in a dozen usage sessions is too many. Two in a year of frequent use is probably poor design but Canon are unlikely to fix it.
Two in a month or few is too many.
I had a heavily used DSLR that very occasionally would produce bright purple images. The first time it happened was in the middle of a wedding and I did not know how to fix it. Backup cameras have their place. I found soon thereafter (next quiet spot during same wedding) that unseating and seating the lens fixed it. Happened infequently enough that it was not certain that contact cleaning helped. Definitely "enemy action" though.
My home LAN router crashes every few weeks - it's probably lack of robust design greatly helped by enemy action. The switch that distributes LAN signals around the house crashes about once every 6 months. Not quite coincidence but power glitches and a less than bulletproof design would explain it.
If your lens never does that again it's happenstance.
It may well be a dirty contact fault as John says.
But that may have been caused by an exceptionally rare whiff of something gaseous or some particulate (blown pollen?) when you last changed your lens. Or a timing waveform that is in spec 99.9999% of the time finding that 1 in a million is not that unlikely after all (all those 9's look good, but you need a few more than that for real reliability at processor speeds).