Despite what others have suggested, I still believe that it is a software problem. I think it has something to do with iOS 14 and RAM management. The camera, especially in the 12 series, and ESPECIALLY the 12 Pro Max demands a lot of resources, and I think that you're right that the camera seems to function slower up until it starts crashing, and then with a restart it's like new again for a while.
I'm definitely no expert but that sounds like running out of RAM. Yet my 12 Pro Max has more RAM than any iOS device I've ever used (my last phone had half as much) and I've never had such issues.