This is the only way I got it to stop> Found on Page 3 of this thread but I can't reply to it for whatever reason...:
"Settings - Device Care - Battery - Camera
Disable "Put app to sleep"
If this setting is left in the ON position it will create conflict with app's ability to properly shut down when exiting Camera.
Hope it helps"
All of the other settings etc were temporary fixes.
Just fixed it in mine... Go to optimization. And turn it off for the camera app. I've had other issues associated with the optimization software. Try it and chime back let me know if it worked.
Another user susgested this and it worked for me:
"Go to Settings, device care, tap battery, then look for the camrea app, and make sure put to sleep option is turned off."