Sometimes replacement cameras are defective too.
Just to rule out software issues, hard re-boot your iPhone.
If no change, try restoring your software from DFU mode.
(Just in case you are not familiar with how to do the above, ask, I'll give you a detailed explanation).
Then try on a KNOWN GOOD camera, known to work well on a different phone or that has been tested somehow.
If none of the above works, you could have some other issues on the logic board. But you'd better rule out the above first.
By the way, are you sure your camera is not focusing? Could it be by any chance something covering/smudging the sapphire lens from outside or even inside of the iPhone case?