In RealSense SDK 2.0, a "Projection" system is used for coordinates, with two types of projection function: Projection and Deprojection.
Projection takes a point from a stream's 3D coordinate space, and maps it to a 2D pixel location on that stream's images. It is provided by the function rs2_project_point_to_pixel.
Deprojection takes a 2D pixel location on a stream's images, as well as a depth, specified in meters, and maps it to a 3D point location within the stream's associated 3D coordinate space. It is provided by the function rs2_deproject_pixel_to_point.
So it sounds like you should use Deprojection for a 2D to 3D coordinate conversion.
I do not have a C# script example for the rs2_deproject_pixel_to_point function, though there is discussion about mapping a pixel to a point that may be useful to you.