Proper way to define BRep edges from line segments projected to a surface?

I have tried many different methods of creating a shell-based B-Rep consisting of faces bounded by polylines with endpoints already on the surface. The only thing I need to do, I think, is define curve geometry that adheres to the surface, and provide it to `BRepBuilderAPI_MakeEdge(curve, start_pt, end_pt)`.
I have tried the following:
- just using line segments, but for curved surfaces this does not work even if I sample the points very finely and set the thresholds to be permissive.
- Replacing the line segments with intersections (GeomAPI_IntSS) between the surface and a plane tangent to the surface normal and line segment, but I haven't gotten this to produce a valid shape
- Using `ProjLib_ProjectedCurve(GeomAdaptor_Surface(surf), GeomAdaptor_Curve(line))`, but for the life of me I cannot find out how to get a type of curve from this function that is compatible with BRepBuilderAPI_MakeEdge(). I found some old references to a function `GeomProjLib::Project` in an earlier thread (https://dev.opencascade.org/content/project-edge-over-curved-surface) but it seems not to exist.