GPT is not going to work very well for Revit geometry stuff as it is built to the lowest common denominator of use, and most of the time when a method doesn’t directly exist it hallucinates stuff, and many geometry API methods that are common in other tools don’t exist in the Revit API.
The hard coded node you illustrated uses the Dynamo geometry library, not Revit elements. You could convert the objects to Dynamo geometry and intersect them by calling the Dynamo method.
As the Revit API doesn’t have an intersection method to use here, you have to build your own. One method I like is to build a face/solid and intersect that, as there are Revit API intersection tools for those classes. However for the simple case of a line you can build your own intersection method without too much legwork (curves are more complex). There is a blog post with outlined logic and a C# implementation here: https://www.parametriczoo.com/index.php/2020/03/07/plane-line-intersection-in-revit-api/ .