Find a local repair shop that does iPhone repairs and get a quote for replacing the camera module. It is a straight swap, they literally just plug into a connector on the main board and that's it.
If possible, have them do it while you're there and try a new one in it to see if it fixes the problem. If not, you clearly won't need the new camera module.
I'd do this myself but I don't know where you are. I've done this before with various other parts where someone brought in a device and I hooked up a new digitizer or LCD just to verify that was the problem so they weren't getting ripped off.
Good luck