Is this a hardware issue? Shall I replace my camera? Found a compatible camera module on amazon for €8, can I expect that to solve the problem?
I think it cannot read QR codes precisely because the image is out of focus, i.e. one problem depends on the other.
Please refer to the following FAQ to clear the camera data and check if the issue improves.
[Phone] Troubleshooting - I cannot launch the Camera
If the problem persists, it is indeed possible that the camera module is malfunctioning.
Since the component you wish to purchase is not provided by us, we cannot guarantee its stability and reliability.
Sorry for any inconvenience it may be caused.
Posting a reply to my own question in case someone who's googling the same problem comes to this thread. Replacing the camera module solved the problem indeed. It can get now clear pictures from a close distance, including readable pictures of documents or scanning QR codes. The procedure to replace it is found on youtube and it's very similar to replacing the battery, I did it with a hair drier instead of a heat gun and everything went smoothly.