I fixed my iPhone 7 plus with the same issue by replacing the rear camera and the phone works very well right now.
open