How to get the pitch of a point relative to the camera's plane of rotation with Python API
Compute the distance between the camera and the point projected onto the plane, i.e. d = point_in_local_coords.xz.length. Then compute the angle using a = atan(d, point_in_local_coords.y).

For bonus points: where you went wrong is the assumption that the angle you want to compute is unaffected by the point's local x and z coordinates.

PS: I'm typing this on my phone, without Blender to test, so I might have a typo in my math somewhere.