Default gun system, camera correction when on wall

I have encountered a problem with the default gun system again that I wish to fix. The camera seems to be fine handling side corrections but it completely ignores it when the camera is behind the player.
You can see the video below where the camera is where it’s not suppose to be.


I originally attempted to modify some of the code in the shoulder library script but it seems a bit complicated for me to understand.