ScreenToWorldPoint returns the wrong position with Pixel Perfect Camera

,

I am currently having an issue where as soon as I turn on Pixel Perfect Camera, all results from ScreenToWorldPoint become completely skewed. And to make matters worse the amount it is skewed by seems to change depending on resolution.

Using 2021.3.11f1 Personal.

It is set up as seen in the included GIF.

And this is the code responsible:

Vector3 camToWorld = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.nearClipPlane);
rigidBody.transform.position = new Vector2(camToWorld.x, camToWorld.y);

I have tried setting the Z of the Vector3 passed into various values like -100, -10, 0, 10 and 100 and none of that seemed to make any difference.

I have also tried to work around it by adding a secondary camera without Pixel Perfect Camera and attaching that to the same Cinema Machine vcam but no dice.

Any help is greatly appreciated.

8655315--1165128--Unity_MPb3S0r93e.gif

The issue seems to be resolved but I’m not sure what did it.
I upgraded from 2021.3.11f1 to 2021.3.16f1, then reinstalled the 2D and Cinema Machine packages and completely set up the camera from scratch again.