If this had been due to an ability to see infrared, it would have happened more than once, as Face ID does this fairly constantly - it's not just a matter of unlocking the phone, but also "attention awareness" features the detect when you are looking at the phone.
I don't have medical expertise, but it seems like it could have been some sort of vision "incident" - a burst capillary or a speck of dust landing on the eye, or some such.
Considering it happened just once, probably nothing to worry about, but if it repeats you may want to consider consulting a doctor instead of/in addition to an iPhone forum.