I had a same problem last night and aroUnd a month ago. It was around that my phone was black out 30 min both times.
last night my phone was connected to Boss speaker and I could hear the clicking sound and camera shutting sound. After my phone became normal, I could check my phone took the photos while it was back-out itself.
It is so strange, I sleeved had this problem before since I stick to iPhone more than 15years.
I also worry about when I really need a phone and if it won’t work. Sometimes I don’t bring my wallet or anything without phone when I go for walk shortly. And usually I use my flights tickets in my phone. I am going to go to Apple Store and will ask about it.