I had the same issue recently and I was able to solve it. Basically I had adjusted the relative x location of the camera boom. This resulted in it starting in a position outside of the character collision capsule. When close to a wall the start position of the camera boom would collide with the wall and the camera would snap inside of the player. So to fix it I just had to ensure the relative position of the camera boom was always inside the collision capsule.
To check if this is the cause play inside the editor, then eject from the player character, then click on the player character and you should see the camera boom as a red line. If the camera boom starts outside of the collision capsule this could be your problem.