Hi swila,
I have to agree with @leooooooooo that replacing the camera module is probably your best bet for fixing your phone at this point.
However, you should be aware that doing so comes with some caveats. In keeping with Apple's increasing predilection for parts pairing, starting with the iPhone 12 they added the rear cameras to the list of parts that only Apple can replace without consequences.
From what I've read, it appears that replacing your camera module, whether that's with an aftermarket or a genuine Apple part, will result in a pop-up warning to the effect that your camera might not be genuine (even if it is) for something like four days, and afterwards you'll have a permanent badge on the Settings icon indicating that there's a notice there saying the same thing. Earlier versions of iOS caused significant issues when the camera module was switched out, but later and current versions just have the warning as the only effect.
There are a few ways to get rid of that warning. The first and most obvious is to pay Apple to replace the cameras, during which they will pair the new camera to your phone. You can also use their self repair program where you buy the camera module from Apple and rent their equipment to do the repair. From what I've seen, doing so is only moderately cheaper than paying Apple full price.
Otherwise, you could simply elect to ignore the warning; according to iFixit's analysis that should be the only consequence of doing the repair yourself or paying a non-Apple repair shop. Here's what they had to say about it.
The New “Important” iPhone Camera Message Is Another Bad Omen - iFixit
Finally, with the release of iOS 18, Apple has released their Repair Assistant that will let you pair (or "calibrate" as they euphemistically call it) your genuine Apple camera module. I'm not fully up to speed with it so I can't say whether it will work with a used module or if you absolutely have to buy a new one, but it does have to be a genuine part; aftermarket cameras won't work with it.
Sounds like you probably know where to look, but just for the sake of completeness, here's the guide for replacing your camera module.
iPhone 12 Pro Max Rear-Facing Cameras Replacement - iFixit Repair Guide
Good luck, and be sure to come on back and let us know how it all turns out. I'd be interested in hearing about your experience with the Repair Assistant if you choose to go that route.
crwdns2934105:0crwdne2934105:0
crwdns2934113:0crwdne2934113:0
crwdns2915270:0crwdne2915270:0
crwdns2889612:0crwdne2889612:0
2